tests/readlink.py
author Siddharth Agarwal <sid0@fb.com>
Fri, 21 Mar 2014 16:09:17 -0700
changeset 20840 308344d80fe5
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
subrepo: factor out Git version check to add doctests Followup to 6a2acb0d9352::e5641536e4d5.

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