tests/readlink.py
author Matt Harbison <matt_harbison@yahoo.com>
Wed, 24 Jul 2024 22:40:22 -0400
changeset 51732 43460c311c0c
parent 48875 6000f5b25c9b
permissions -rwxr-xr-x
typing: add trivial type hints to `mercurial.scmutil` There's still a lot to go, but there's a lot here already, so I tried to keep it to obvious/trivial things. I didn't bother with contexts, matchers, and revisions that can be `bytes | int | None`.

#!/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)