tests/readlink.py
author Gregory Szorc <gregory.szorc@gmail.com>
Sun, 20 Feb 2022 15:28:44 -0700
changeset 48967 42d2b31cee0b
parent 48966 6000f5b25c9b
permissions -rwxr-xr-x
tests: remove from __future__ from inline Python in tests This is no longer required since we require Python 3 and the linter no longer requires these statements. Differential Revision: https://phab.mercurial-scm.org/D12255

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