view tests/readlink.py @ 24869:95a67d687903 stable

histedit: fix reST syntax problem of example code in help document To show example code correctly in online help, text block of it should be preceded by "::" and indented.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Tue, 28 Apr 2015 23:27:18 +0900
parents 08a0f04b56bd
children 328739ea70c3
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, err:
        if err.errno != errno.EINVAL:
            raise
        print f, 'not a symlink'

sys.exit(0)