view tests/readlink.py @ 26264:ac4ed8d6ec50

obsolete: drop an empty line at the end of a docstring This empty line is useless, let's drop it.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 15 Sep 2015 13:10:25 -0700
parents 328739ea70c3
children 7bcfb9090c86
line wrap: on
line source

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