tests/readlink.py
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Tue, 05 Nov 2013 10:55:45 +0100
branchstable
changeset 19980 0151b61fed97
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
test: do not add .pyc and .orig in test-commit-amend.t (issue4085) This makes the test fails with disabled byte-compilation (PYTHONDONTWRITEBYTECODE="1" environmental variable).

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