8000 Update typeshed to fix TextIOWrapper constructor (#8965) · python/mypy@84bcb25 · GitHub
[go: up one dir, main page]

Skip to content

Commit 84bcb25

Browse files
authored
Update typeshed to fix TextIOWrapper constructor (#8965)
Currently it doesn't accept ZipFile.open()'s output and fails with `error: Argument 1 to "TextIOWrapper" has incompatible type "IO[bytes]"; expected "BinaryIO"` That was fixed in python/typeshed@3058bec
1 parent 068594e commit 84bcb25

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

mypy/modulefinder.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ def default_lib_path(data_dir: str,
448448

449449

450450
@functools.lru_cache(maxsize=None)
451-
def get_site_packages_dirs(python_executable: Optional[str]) -> Tuple[List[str], List[str]]:
451+
def get_site_packages_dirs(python_executable: str) -> Tuple[List[str], List[str]]:
452452
"""Find package directories for given python.
453453
454454
This runs a subprocess call, which generates a list of the egg directories, and the site
@@ -461,8 +461,6 @@ def make_abspath(path: str, root: str) -> str:
461461
else:
462462
return os.path.join(root, os.path.normpath(path))
463463

464-
if python_executable is None:
465-
return [], []
466464
if python_executable == sys.executable:
467465
# Use running Python's package dirs
468466
site_packages = sitepkgs.getsitepackages()
@@ -543,7 +541,11 @@ def compute_search_paths(sources: List[BuildSource],
543541
if alt_lib_path:
544542
mypypath.insert(0, alt_lib_path)
545543

546-
egg_dirs, site_packages = get_site_packages_dirs(options.python_executable)
544+
if options.python_executable is None:
545+
egg_dirs = [] # type: List[str]
546+
site_packages = [] # type: List[str]
547+
else:
548+
egg_dirs, site_packages = get_site_packages_dirs(options.pyth B877 on_executable)
547549
for site_dir in site_packages:
548550
assert site_dir not in lib_path
549551
if (site_dir in mypypath or

mypy/typeshed

Submodule typeshed updated 145 files

mypyc/analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def __init__(self,
3030

3131
def __str__(self) -> str:
3232
lines = []
33-
lines.append('exits: %s' % sorted(self.exits))
33+
lines.append('exits: %s' % sorted(self.exits, key=lambda e: e.label))
3434
lines.append('succ: %s' % self.succ)
3535
lines.append('pred: %s' % self.pred)
3636
return '\n'.join(lines)

0 commit comments

Comments
 (0)
0