view tests/readlink.py @ 21070:408877d491fb

bundle2: feed a binary stream to `peer.unbundle` This input will have to travel over the wire anyway, so we feed the peer method with a simple binary stream and rely on the server side to use `readbundle` to create the python object. The test output changes because the bundle is created marginally sooner and the debug output interleaves in a different way.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 15 Apr 2014 16:42:52 -0400
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)