view tests/readlink.py @ 25667:a69bb29b9638

localrepo: kill off sopener (API) sopener is deprecated since 7034365089bf (Mercurial 2.3). It's annoying for extension authors to have to deal with both. Let's just kill it off.
author Siddharth Agarwal <sid0@fb.com>
date Thu, 25 Jun 2015 22:17:52 -0700
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)