Skip to content

Commit 7b88327

Browse files
committed
fixup! Search sys.path for PEP-561 compliant packages
1 parent f29cd7e commit 7b88327

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

mypy/modulefinder.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
else:
1818
import tomli as tomllib
1919

20-
from typing import Dict, Iterator, List, NamedTuple, Optional, Set, Tuple, Union
20+
from typing import Dict, List, NamedTuple, Optional, Set, Tuple, Union
2121
from typing_extensions import Final, TypeAlias as _TypeAlias
2222

2323
from mypy.fscache import FileSystemCache
@@ -721,7 +721,8 @@ def compute_search_paths(sources: List[BuildSource],
721721
assert search_dir not in lib_path
722722
if (search_dir in mypypath or
723723
any(p.startswith(search_dir + os.path.sep) for p in mypypath) or
724-
os.path.altsep and any(p.startswith(search_dir + os.path.altsep) for p in mypypath)):
724+
(os.path.altsep
725+
and any(p.startswith(search_dir + os.path.altsep) for p in mypypath))):
725726
print("{} is in the MYPYPATH. Please remove it.".format(search_dir), file=sys.stderr)
726727
print("See https://mypy.readthedocs.io/en/stable/running_mypy.html"
727728
"#how-mypy-handles-imports for more info", file=sys.stderr)

mypy/pyinfo.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
possible.
88
"""
99
import os
10-
import site
1110
import sys
1211
import sysconfig
1312

@@ -16,7 +15,7 @@
1615

1716
MYPY = False
1817
if MYPY:
19-
from typing import List, Tuple
18+
from typing import List
2019

2120

2221
def getsearchdirs():

0 commit comments

Comments
 (0)