Mercurial > hg
view tests/readlink.py @ 29456:e61d384e3be4
keepalive: switch from thread to threading module
The thread module in py3 is renamed to _thread, but we can use
the high level threading module instead.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Fri, 01 Jul 2016 19:17:16 +0530 |
parents | 7bcfb9090c86 |
children | 6a98f9408a50 |
line wrap: on
line source
#!/usr/bin/env python from __future__ import print_function 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, '->', f, 'not a symlink') sys.exit(0)