Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add back workaround to avoid confusing mypy.types and types in pyinfo #13176

Merged
merged 1 commit into from Jul 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions mypy/pyinfo.py
Expand Up @@ -14,6 +14,15 @@
if MYPY:
from typing import List

if __name__ == '__main__':
# HACK: We don't want to pick up mypy.types as the top-level types
# module. This could happen if this file is run as a script.
# This workaround fixes it.
old_sys_path = sys.path
sys.path = sys.path[1:]
import types # noqa
sys.path = old_sys_path


def getsearchdirs():
# type: () -> List[str]
Expand Down