Mercurial > hg
annotate tests/readlink.py @ 6289:91ac1726730a
issue 1003: send all data properly
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Sun, 16 Mar 2008 22:59:04 -0700 |
parents | 396c7010b0cd |
children | 08a0f04b56bd |
rev | line source |
---|---|
5683
396c7010b0cd
Use common readlink.py instead of own implementations per test script.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
1 #!/usr/bin/env python |
396c7010b0cd
Use common readlink.py instead of own implementations per test script.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
2 |
396c7010b0cd
Use common readlink.py instead of own implementations per test script.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
3 import errno, os, sys |
396c7010b0cd
Use common readlink.py instead of own implementations per test script.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
4 |
396c7010b0cd
Use common readlink.py instead of own implementations per test script.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
5 for f in sys.argv[1:]: |
396c7010b0cd
Use common readlink.py instead of own implementations per test script.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
6 try: |
396c7010b0cd
Use common readlink.py instead of own implementations per test script.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
7 print f, '->', os.readlink(f) |
396c7010b0cd
Use common readlink.py instead of own implementations per test script.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
8 except OSError, err: |
396c7010b0cd
Use common readlink.py instead of own implementations per test script.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
9 if err.errno != errno.EINVAL: raise |
396c7010b0cd
Use common readlink.py instead of own implementations per test script.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
10 print f, 'not a symlink' |
396c7010b0cd
Use common readlink.py instead of own implementations per test script.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
11 |
396c7010b0cd
Use common readlink.py instead of own implementations per test script.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
12 sys.exit(0) |