]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Strip all whitespace at the end of a line when validating paths specified in
authorBrett Cannon <bcannon@gmail.com>
Sat, 20 Mar 2004 21:14:25 +0000 (21:14 +0000)
committerBrett Cannon <bcannon@gmail.com>
Sat, 20 Mar 2004 21:14:25 +0000 (21:14 +0000)
a .pth file.
Fixes bug #700055 .

Lib/site.py

index 7282190eee59ab9253a03dc2e6fb27c43922bc1b..49cf8fa4322c00369138227e4d7c81a25b8cb504 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)