]> granicus.if.org Git - python/commitdiff
Fix how line endings were handled when iterating over a .pth file by stripping
authorBrett Cannon <bcannon@gmail.com>
Sat, 20 Mar 2004 21:08:17 +0000 (21:08 +0000)
committerBrett Cannon <bcannon@gmail.com>
Sat, 20 Mar 2004 21:08:17 +0000 (21:08 +0000)
all whitespace at the end of the path line.

Lib/site.py

index f8c000a6788d441e4db28574311d260de182a734..682bbd5e407efac3f759fbd59e67076693ccdd9d 100644 (file)
@@ -148,8 +148,7 @@ def addpackage(sitedir, name):
         if dir.startswith("import"):
             exec dir
             continue
-        if dir[-1] == '\n':
-            dir = dir[:-1]
+        dir = dir.rstrip()
         dir, dircase = makepath(sitedir, dir)
         if not dircase in _dirs_in_sys_path and os.path.exists(dir):
             sys.path.append(dir)