@@ -243,7 +243,7 @@ def sampled_from(
243
243
return LazyStrategy (one_of , args = inner , kwargs = {}, force_repr = force_repr )
244
244
if not values :
245
245
246
- def has_annotations ():
246
+ def has_annotations (elements ):
247
247
if sys .version_info [:2 ] < (3 , 14 ):
248
248
return vars (elements ).get ("__annotations__" )
249
249
else : # pragma: no cover # covered by 3.14 tests
@@ -254,7 +254,7 @@ def has_annotations():
254
254
if (
255
255
isinstance (elements , type )
256
256
and issubclass (elements , enum .Enum )
257
- and has_annotations ()
257
+ and has_annotations (elements )
258
258
):
259
259
# See https://github.com/HypothesisWorks/hypothesis/issues/2923
260
260
raise InvalidArgument (
@@ -1120,11 +1120,11 @@ def builds(
1120
1120
the callable.
1121
1121
"""
1122
1122
if not callable (target ):
1123
- from .types import is_a_union
1123
+ from hypothesis . strategies . _internal .types import is_a_union
1124
1124
1125
1125
# before 3.14, unions were callable, so it got an error message in
1126
- # BuildsStrategy.do_draw instead . In 3.14+, unions are not callable, so
1127
- # we can error earlier here instead.
1126
+ # BuildsStrategy.do_draw. In 3.14+, unions are not callable, so
1127
+ # we error earlier here instead.
1128
1128
suggestion = (
1129
1129
f" Try using from_type({ target } ) instead?" if is_a_union (target ) else ""
1130
1130
)
0 commit comments