Skip to content

Commit 98893d0

Browse files
giogranobentsku
authored andcommitted
get_origin might fall into infinite recusion
1 parent 766b121 commit 98893d0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/py_avro_schema/_schemas.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1459,7 +1459,10 @@ def _is_list_any(py_type: Type) -> bool:
14591459

14601460
def is_logically_json(py_type: Type) -> bool:
14611461
"""Returns whether a given type is logically a JSON and can be serialized as such"""
1462-
return _is_list_any(py_type) or _is_list_dict_str_any(py_type) or _is_dict_str_any(py_type)
1462+
try:
1463+
return _is_list_any(py_type) or _is_list_dict_str_any(py_type) or _is_dict_str_any(py_type)
1464+
except RecursionError:
1465+
return False
14631466

14641467

14651468
def _is_class(

0 commit comments

Comments
 (0)