tests/readlink.py
author Gregory Szorc <gregory.szorc@gmail.com>
Sun, 27 Mar 2016 13:50:34 -0700
changeset 28649 7acab42ef184
parent 25660 328739ea70c3
child 29175 7bcfb9090c86
permissions -rwxr-xr-x
sslutil: implement SSLContext class Python <2.7.9 doesn't have a ssl.SSLContext class. In this patch, we implement the interface to the class so we can have a unified code path for all supported versions of Python. This is similar to the approach that urllib3 takes.

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