view tests/readlink.py @ 48694:5c940f9ba3e4

dagop: don't import nullrev from .node twice See 59fa3890d40a. Differential Revision: https://phab.mercurial-scm.org/D12120
author Anton Shestakov <av6@dwimlabs.net>
date Mon, 31 Jan 2022 18:04:11 +0300
parents c102b704edb5
children 6000f5b25c9b
line wrap: on
line source

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