diff --git a/sphinx_json_schema/compat.py b/sphinx_json_schema/compat.py new file mode 100644 index 0000000..26eed00 --- /dev/null +++ b/sphinx_json_schema/compat.py @@ -0,0 +1,7 @@ + +try: + # Python >= 3.8 + from collections.abc import Mapping +except ImportError: + # Python < 3.8 + from collections import Mapping diff --git a/sphinx_json_schema/mergers.py b/sphinx_json_schema/mergers.py index dd68abd..718550c 100644 --- a/sphinx_json_schema/mergers.py +++ b/sphinx_json_schema/mergers.py @@ -2,8 +2,7 @@ JSON schema loader helpers """ -from collections import Mapping -from copy import deepcopy +from .compat import Mapping def merge(base, to_merge, mode):