tests/readlink.py
author Pulkit Goyal <7895pulkit@gmail.com>
Tue, 09 Mar 2021 11:19:11 +0530
branchstable
changeset 46574 ed3fb1ae5ab1
parent 45830 c102b704edb5
child 48875 6000f5b25c9b
permissions -rwxr-xr-x
Added signature for changeset d5d9177c0045

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