view tests/readlink.py @ 48541:ba34141f8dbb

filemerge: stop passing around 3 unused `None` values in `files` argument Since 67cfffbfb6a0 (filemerge: eliminate most uses of tempfiles, 2017-08-31), we have used only the last entry in the `files` tuple that gets passed around to various functions. That commit said "Emphasize that they're unused so we can more easily remove them later.". It's now "later". Differential Revision: https://phab.mercurial-scm.org/D11877
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 06 Dec 2021 12:48:01 -0800
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)