mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-33689: Blank lines in .pth file cause a duplicate sys.path entry (GH-20679)
This commit is contained in:
parent
ae0d2a33ec
commit
0c71a66b53
3 changed files with 12 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue