tests/readlink.py
author Pierre-Yves David <pierre-yves.david@octobus.net>
Sat, 19 Dec 2020 15:56:54 +0100
changeset 46166 c511fef30290
parent 45849 c102b704edb5
child 48966 6000f5b25c9b
permissions -rwxr-xr-x
bundle2: drop some outdated comment This commend trace back to a very early bundle2 changeset c7ceae0faf69. And the code moved past this warning over 5 years ago. Differential Revision: https://phab.mercurial-scm.org/D9637

#!/usr/bin/env python3

from __future__ import absolute_import, print_function

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)