tests/readlink.py
author Yuya Nishihara <yuya@tcha.org>
Tue, 05 Apr 2016 23:21:17 +0900
changeset 28808 10c2ce44c35d
parent 25660 328739ea70c3
child 29175 7bcfb9090c86
permissions -rwxr-xr-x
test-hgweb-auth: stop direct symbol import of mercurial.error.Abort

#!/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)