tests/readlink.py
author Yuya Nishihara <yuya@tcha.org>
Sat, 15 Oct 2016 14:30:16 +0900
changeset 30522 ff7df4bb75de
parent 29485 6a98f9408a50
child 45849 c102b704edb5
permissions -rwxr-xr-x
chgserver: make it a core module and drop extension flags It was an extension just because there were several dependency cycles I needed to address. I don't add 'chgserver' to extensions._builtin since chgserver is considered an internal extension so nobody should enable it by their config.

#!/usr/bin/env python

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)