tests/readlink.py
author Patrick Mezard <pmezard@gmail.com>
Mon, 14 Nov 2011 18:16:01 +0100
changeset 15510 5414b56cfad6
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
patch: simplify hunk extents parsing Do not capture unwanted groups in regexps

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