Skip to content

Commit 56a9afb

Browse files
committed
get_origin might fall into infinite recusion
1 parent b4e4e75 commit 56a9afb

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
@@ -1423,7 +1423,10 @@ def _is_list_any(py_type: Type) -> bool:
14231423

14241424
def is_logically_json(py_type: Type) -> bool:
14251425
"""Returns whether a given type is logically a JSON and can be serialized as such"""
1426-
return _is_list_any(py_type) or _is_list_dict_str_any(py_type) or _is_dict_str_any(py_type)
1426+
try:
1427+
return _is_list_any(py_type) or _is_list_dict_str_any(py_type) or _is_dict_str_any(py_type)
1428+
except RecursionError:
1429+
return False
14271430

14281431

14291432
def _is_class(

0 commit comments

Comments
 (0)