tests/readlink.py
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Mon, 14 Oct 2013 18:59:12 +0200
changeset 19904 5b327880a660
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
shelve: drop pickle usage Pickle was used to the `shelvedstate` file. However the content of the file is very simple and we can handle serialisation ourself. Not using pickle is a net win. Note incrementing the format version as no releases have been done so far.

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