summaryrefslogtreecommitdiffstats
path: root/Lib/site.py
diff options
context:
space:
mode:
authoridomic <michael.ido@gmail.com>2020-09-19 19:13:29 (GMT)
committerGitHub <noreply@github.com>2020-09-19 19:13:29 (GMT)
commit0c71a66b53f6ea262aa5a60784c8c625ae0bb98c (patch)
tree496b2a1bdaedda9a2fd849a8c4ffb8688b14b98c /Lib/site.py
parentae0d2a33ec05aece939a959d36fcf1df1e210a08 (diff)
downloadcpython-0c71a66b53f6ea262aa5a60784c8c625ae0bb98c.zip
cpython-0c71a66b53f6ea262aa5a60784c8c625ae0bb98c.tar.gz
cpython-0c71a66b53f6ea262aa5a60784c8c625ae0bb98c.tar.bz2
bpo-33689: Blank lines in .pth file cause a duplicate sys.path entry (GH-20679)
Diffstat (limited to 'Lib/site.py')
-rw-r--r--Lib/site.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/site.py b/Lib/site.py
index 4c09577..4d3b869 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -170,6 +170,8 @@ def addpackage(sitedir, name, known_paths):
for n, line in enumerate(f):
if line.startswith("#"):
continue
+ if line.strip() == "":
+ continue
try:
if line.startswith(("import ", "import\t")):
exec(line)