* [gentoo-commits] gentoo-projects commit in pax-utils/tests/source: space.py
@ 2011-03-04 21:04 Mike Frysinger (vapier)
0 siblings, 0 replies; only message in thread
From: Mike Frysinger (vapier) @ 2011-03-04 21:04 UTC (permalink / raw
To: gentoo-commits
vapier 11/03/04 21:04:06
Modified: space.py
Log:
patch by Arfrever Frehtes Taifersar Arahesis for python-3
Revision Changes Path
1.2 pax-utils/tests/source/space.py
file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/tests/source/space.py?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/tests/source/space.py?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/tests/source/space.py?r1=1.1&r2=1.2
Index: space.py
===================================================================
RCS file: /var/cvsroot/gentoo-projects/pax-utils/tests/source/space.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- space.py 30 Dec 2008 12:34:20 -0000 1.1
+++ space.py 4 Mar 2011 21:04:06 -0000 1.2
@@ -9,19 +9,22 @@
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:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-03-04 21:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-04 21:04 [gentoo-commits] gentoo-projects commit in pax-utils/tests/source: space.py Mike Frysinger (vapier)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox