tests/readlink.py
author Pierre-Yves David <pierre-yves.david@fb.com>
Tue, 06 Oct 2015 02:08:32 -0700
changeset 26553 89b806a09a66
parent 25660 328739ea70c3
child 29175 7bcfb9090c86
permissions -rwxr-xr-x
extract: move 'date' assignment where it is parsed There is one setter and no consumer, we can move it there directly.

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