bpo-33689: Blank lines in .pth file cause a duplicate sys.path entry (GH-20679)

This commit is contained in:
idomic 2020-09-19 15:13:29 -04:00 committed by GitHub
parent ae0d2a33ec
commit 0c71a66b53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 1 deletions

View file

@ -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)