diff --git a/hypothesis-python/src/hypothesis/extra/_patching.py b/hypothesis-python/src/hypothesis/extra/_patching.py index 8f53076d72..d3678e3f9f 100644 --- a/hypothesis-python/src/hypothesis/extra/_patching.py +++ b/hypothesis-python/src/hypothesis/extra/_patching.py @@ -121,7 +121,7 @@ def __call_node_to_example_dec(self, node, via): cst.Module([]).code_for_node(via), mode=black.FileMode(line_length=self.line_length), ) - except ImportError: + except (ImportError, AttributeError): return None # See https://github.com/psf/black/pull/4224 via = cst.parse_expression(pretty.strip()) return cst.Decorator(via)