tests/readlink.py
author Simon Sapin <simon.sapin@octobus.net>
Tue, 12 Oct 2021 15:43:45 +0200
changeset 48209 63e86fc9bfec
parent 45849 c102b704edb5
child 48966 6000f5b25c9b
permissions -rwxr-xr-x
rust: update the rust-cpython crate to 0.7.0 This notably brings support for Python 3.10, and includes the panic message when propagating a Rust panic as a Python exception. https://github.com/dgrunwald/rust-cpython/blob/master/CHANGELOG.md#070---2021-10-09 Differential Revision: https://phab.mercurial-scm.org/D11630

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