Mercurial > hg
view tests/readlink.py @ 26107:50582df9d7a7
parsers: fix two cases of unsigned long instead of Py_ssize_t
We had to do this before because Python 2.4 didn't understand the n
format specifier in Py_BuildValue and friends. We no longer have that
problem.
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 26 Aug 2015 10:20:07 -0400 |
parents | 328739ea70c3 |
children | 7bcfb9090c86 |
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 as err: if err.errno != errno.EINVAL: raise print f, 'not a symlink' sys.exit(0)