Use rstrip("\n") to remove trailing newlines from
authorZac Medico <zmedico@gentoo.org>
Mon, 29 Oct 2007 05:26:59 +0000 (05:26 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 29 Oct 2007 05:26:59 +0000 (05:26 -0000)
CONTENTS lines.

svn path=/main/trunk/; revision=8338

pym/portage/dbapi/vartree.py

index 6c10b786682738dbcc869906979e09ce8a4a43d2..bfa052f6eab142110d267a5b40df2c43a0b7179a 100644 (file)
@@ -970,8 +970,7 @@ class dblink(object):
                                        "file, line %d: '%s'\n" % (pos, contents_file),
                                        noiselevel=-1)
                                continue
-                       if line.endswith("\n"):
-                               line = line[:-1]
+                       line = line.rstrip("\n")
                        # Split on " " so that even file paths that
                        # end with spaces can be handled.
                        mydat = line.split(" ")