tests/readlink.py
author Yuya Nishihara <yuya@tcha.org>
Tue, 16 Jan 2018 23:50:01 +0900
changeset 35744 8685192a8733
parent 29485 6a98f9408a50
child 45849 c102b704edb5
permissions -rwxr-xr-x
templater: fix crash by empty group expression 'exp' may be None because of '(group None)' node. The error message is copied from revset.py.

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