Mercurial > hg
view tests/readlink.py @ 49806:9eb69fa5a783
statprof: don't pass str `sys.argv` to a function expecting bytes
Found by typing the global functions in mercurial.pycompat.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Wed, 14 Dec 2022 22:27:22 -0500 |
parents | 6000f5b25c9b |
children |
line wrap: on
line source
#!/usr/bin/env python3 import errno import os import 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)