Skip to content

Commit

Permalink
fix(mergers): fix Mapping import (changed in python 3.8)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkhyn committed Feb 8, 2022
1 parent 9397a20 commit df5e10b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 7 additions & 0 deletions sphinx_json_schema/compat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

try:
# Python >= 3.8
from collections.abc import Mapping
except ImportError:
# Python < 3.8
from collections import Mapping
3 changes: 1 addition & 2 deletions sphinx_json_schema/mergers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit df5e10b

Please sign in to comment.