Skip to content

An easy quick fix for http://bugs.python.org/issue28339 #289

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

Merged
merged 1 commit into from
Oct 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python2/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ def _valid_for_check(cls):
raise TypeError("Class %r cannot be used with class "
"or instance checks" % cls)
if (cls.__origin__ is not None and
sys._getframe(3).f_globals['__name__'] != 'abc'):
sys._getframe(3).f_globals['__name__'] not in ['abc', 'functools']):
raise TypeError("Parameterized generics cannot be used with class "
"or instance checks")

Expand Down
2 changes: 1 addition & 1 deletion src/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ def _valid_for_check(cls):
raise TypeError("Class %r cannot be used with class "
"or instance checks" % cls)
if (cls.__origin__ is not None and
sys._getframe(3).f_globals['__name__'] != 'abc'):
sys._getframe(3).f_globals['__name__'] not in ['abc', 'functools']):
raise TypeError("Parameterized generics cannot be used with class "
"or instance checks")

Expand Down