Skip to content

Commit

Permalink
Merge pull request #2097 from Zac-HD/fix-350
Browse files Browse the repository at this point in the history
Fix typing issue under Python 3.5.0
  • Loading branch information
Zac-HD committed Sep 20, 2019
2 parents 18fdf45 + f9b4a98 commit 6f0c8fd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
5 changes: 5 additions & 0 deletions hypothesis-python/RELEASE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
RELEASE_TYPE: patch

This patch disables part of the :mod:`typing`-based inference for the
:pypi:`attrs` package under Python 3.5.0, which has some incompatible
internal details (:issue:`2095`).
12 changes: 7 additions & 5 deletions hypothesis-python/src/hypothesis/internal/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,13 @@ def qualname(f):
typing_root_type = (typing._Final, typing._GenericAlias) # type: ignore
ForwardRef = typing.ForwardRef # type: ignore
except AttributeError:
typing_root_type = (
typing.TypingMeta,
typing.TypeVar,
typing._Union,
) # type: ignore
typing_root_type = (typing.TypingMeta, typing.TypeVar) # type: ignore
try:
typing_root_type += (typing._Union,) # type: ignore
except AttributeError:
# Under Python 3.5.0, we'll just give up... if users want strategies
# inferred from Union-typed attrs attributes they can try a newer Python.
pass
ForwardRef = typing._ForwardRef # type: ignore


Expand Down

0 comments on commit 6f0c8fd

Please sign in to comment.