Mercurial > hg
view tests/readlink.py @ 7421:4c4324476be6
Catch both IOError and OSError, fix regression introduced by 8046f0a070a6
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Wed, 26 Nov 2008 18:23:35 +0100 |
parents | 396c7010b0cd |
children | 08a0f04b56bd |
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)