tests/readlink.py
author Mads Kiilerich <mads@kiilerich.com>
Fri, 27 Feb 2009 19:10:38 +0100
changeset 7813 076401cf2b63
parent 5683 396c7010b0cd
child 10282 08a0f04b56bd
permissions -rwxr-xr-x
run-tests.py: avoid using popen2.Popen4 - use subprocess instead Use subprocess to emulate Popen4 if available - similar to how it is done in util.py. Using popen2 under python 2.6 gives DeprecationWarning: The popen2 module is deprecated. Use the subprocess module.

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