view tests/readlink.py @ 19822:a194a33f8cb2

mq: prepare a strip extension for extraction Strip will lives in its own extension. The extension is surprisingly called `strip`. (as discussed in issue3824) The `mq` extension force the use of the strip extension when its enabled. This will both necessary for backward compatibility (people expect `mq` to comes with strip) and become some utility function used by `mq` will move in the strip extension.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Thu, 26 Sep 2013 23:10:11 +0200
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)