tests/readlink.py
author Pierre-Yves David <pierre-yves.david@fb.com>
Thu, 16 Apr 2015 03:15:28 -0400
changeset 24793 2ec894582ea2
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
bundle2: add a 'copy' method on parts This is the first step in our quest for preserving the server output on error (issue4594). We want to be able to copy the output parts from the aborted reply into the exception bundle. The function will be used in a later patch.

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