tests/readlink.py
author Pierre-Yves David <pierre-yves.david@octobus.net>
Fri, 01 Sep 2023 11:57:38 +0200
changeset 50915 d8c8a923ee9b
parent 48875 6000f5b25c9b
permissions -rwxr-xr-x
hgweb: use sysstr to get attribute on diff option Attribute identifier should be `str` not `bytes`.

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