view tests/readlink.py @ 28839:de7802c3a1df

tests: import mercurial modules by name in test-propertycache This is our convention, and silences import-checker.py that would say imports weren't lexically sorted.
author Yuya Nishihara <yuya@tcha.org>
date Tue, 05 Apr 2016 23:30:18 +0900
parents 328739ea70c3
children 7bcfb9090c86
line wrap: on
line source

#!/usr/bin/env python

import errno, os, 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, 'not a symlink'

sys.exit(0)