view tests/readlink.py @ 21791:fb16f6da5b3b

check-code: drop ban on callable() which was restored in Python 3.2 A followup will restore use of callable() in place of the awkward hasattr() construction we were using to be one step closer to Python 3.
author Augie Fackler <raf@durin42.com>
date Mon, 23 Jun 2014 09:22:53 -0400
parents 08a0f04b56bd
children 328739ea70c3
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, err:
        if err.errno != errno.EINVAL:
            raise
        print f, 'not a symlink'

sys.exit(0)