tests/readlink.py
author Gregory Szorc <gregory.szorc@gmail.com>
Sat, 08 Oct 2016 22:02:29 +0200
changeset 30100 c5afe5531709
parent 29485 6a98f9408a50
child 45849 c102b704edb5
permissions -rwxr-xr-x
parsers: convert PyString* to PyBytes* With this change, we no longer have any occurrences of "PyString" in our C extensions.

#!/usr/bin/env python

from __future__ import absolute_import, print_function

import errno
import os
import 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, '->', f, 'not a symlink')

sys.exit(0)