Skip to content

Commit

Permalink
Fix stubgen mypyc type mismatch (#6642)
Browse files Browse the repository at this point in the history
find_module_path_and_all_py3 promises to return __all__ as a List, but
__all__ could be a tuple or something. Make sure to convert it.

Fixes #6639.
  • Loading branch information
msullivan committed Apr 15, 2019
1 parent 36200d2 commit 25d5cb5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mypy/stubutil.py
Expand Up @@ -129,7 +129,10 @@ def find_module_path_and_all_py3(module: str) -> Optional[Tuple[str, Optional[Li
raise CantImport(module)
if is_c_module(mod):
return None
return mod.__file__, getattr(mod, '__all__', None)
module_all = getattr(mod, '__all__', None)
if module_all is not None:
module_all = list(module_all)
return mod.__file__, module_all


@contextmanager
Expand Down

0 comments on commit 25d5cb5

Please sign in to comment.