tests/readlink.py
author Yuya Nishihara <yuya@tcha.org>
Sat, 22 Apr 2017 21:09:07 +0900
changeset 32965 3f07f12c6e10
parent 29485 6a98f9408a50
child 45849 c102b704edb5
permissions -rwxr-xr-x
changeset_templater: do not enable verbosity postfix for [templates] section Since this postfix hack exists only for backward compatibility, we don't need it for new [templates] section. This isn't a BC as templates defined in [templates] section weren't loaded until recently.

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