Mercurial > hg
view tests/readlink.py @ 18879:93b03a222c3e
sslutil: try harder to avoid getpeercert problems
We wrap both calls to getpeercert in a try/except to make sure we
catch its bogus AttributeError.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 05 Apr 2013 12:20:14 -0500 |
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)