tests/readlink.py
author Robert Stanca <robert.stanca7@gmail.com>
Mon, 04 Apr 2016 00:27:04 +0300
changeset 28745 8a23f88131c3
parent 25660 328739ea70c3
child 29175 7bcfb9090c86
permissions -rwxr-xr-x
py3: use absolute_import in test-hg-parseurl.py

#!/usr/bin/env python

import errno, os, sys

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

sys.exit(0)