Skip to content

Commit

Permalink
Use get_origin to get appropriate type for issubclass check
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksspirit committed Apr 24, 2023
1 parent a46a423 commit f8e4e74
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

from hypothesis import strategies as st
from hypothesis.errors import InvalidArgument, ResolutionFailed
from hypothesis.internal.compat import PYPY, BaseExceptionGroup, ExceptionGroup
from hypothesis.internal.compat import PYPY, BaseExceptionGroup, ExceptionGroup, get_origin
from hypothesis.internal.conjecture.utils import many as conjecture_utils_many
from hypothesis.strategies._internal.datetime import zoneinfo # type: ignore
from hypothesis.strategies._internal.ipaddress import (
Expand Down Expand Up @@ -423,7 +423,7 @@ def from_typing_type(thing):
else:
union_elems = ()
if not any(
isinstance(T, type) and issubclass(int, T)
isinstance(T, type) and issubclass(int, get_origin(T) or T)
for T in list(union_elems) + [elem_type]
):
mapping.pop(typing.ByteString, None)
Expand Down

0 comments on commit f8e4e74

Please sign in to comment.