tests/readlink.py
author Martin von Zweigbergk <martinvonz@google.com>
Fri, 23 Jan 2015 14:09:49 -0800
changeset 24004 8a5267cd5286
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
parsers: rewrite index_ancestors() in terms of index_commonancestorsheads() The first 80% of index_ancestors() is identical to index_commonancestorsheads(), so just call that function instead.

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