aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-03-04 21:04:06 +0000
committerMike Frysinger <vapier@gentoo.org>2011-03-04 21:04:06 +0000
commit4ac4374c1a99c954baa7480deffe9285309cdbcd (patch)
tree13ca0dadb037191c90449be96cb8f4e5e6f1dd42 /tests
parent- add a cvs Header to lddtree.sh (diff)
downloadpax-utils-4ac4374c1a99c954baa7480deffe9285309cdbcd.tar.gz
pax-utils-4ac4374c1a99c954baa7480deffe9285309cdbcd.tar.bz2
pax-utils-4ac4374c1a99c954baa7480deffe9285309cdbcd.zip
patch by Arfrever Frehtes Taifersar Arahesis for python-3
Diffstat (limited to 'tests')
-rwxr-xr-xtests/source/space.py27
1 files changed, 15 insertions, 12 deletions
diff --git a/tests/source/space.py b/tests/source/space.py
index f1baff9..f465eab 100755
--- a/tests/source/space.py
+++ b/tests/source/space.py
@@ -9,19 +9,22 @@ import sys
def crapspace(fname):
chars = True
- fp = open(fname, "r")
- line = fp.readline()
- while line:
- line = line.rstrip()
- if line:
- chars = True
- print line
- else:
- if chars:
- print ""
- chars = False
-
+ try:
+ fp = open(fname, "r")
line = fp.readline()
+ while line:
+ line = line.rstrip()
+ if line:
+ chars = True
+ print(line)
+ else:
+ if chars:
+ print("")
+ chars = False
+
+ line = fp.readline()
+ finally:
+ fp.close()
if __name__ == "__main__":
if len(sys.argv) < 2: