tests/readlink.py
author Sune Foldager <cryo@cyanite.org>
Wed, 14 Apr 2010 19:11:35 +0200
branchstable
changeset 10908 816bac2f9452
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
prepush: fix bug in warning message selection In certain situations you would be told "you should pull and merge" even when there is nothing to pull.

#!/usr/bin/env python

import errno, os, sys

for f in sys.argv[1:]:
    try:
        print f, '->', os.readlink(f)
    except OSError, err:
        if err.errno != errno.EINVAL:
            raise
        print f, 'not a symlink'

sys.exit(0)