Skip to content

Commit

Permalink
_httpdomain.py: import both collections and collections.abc
Browse files Browse the repository at this point in the history
While a1d4fca fixed the import for
collections.Mapping, using collections.defaultdict broke.

Import both packages, and use them where appropriate.
  • Loading branch information
flokli committed Aug 25, 2022
1 parent a1d4fca commit 4f6bc2e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions sphinxcontrib/openapi/renderers/_httpdomain.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
"""OpenAPI spec renderer."""

import sys
if sys.version_info >= (3, 3):
import collections.abc as collections
else:
import collections

import collections
import collections.abc

import copy
import functools
Expand Down Expand Up @@ -179,7 +178,7 @@ def _get_schema_type(schema):


_merge_mappings = deepmerge.Merger(
[(collections.Mapping, deepmerge.strategy.dict.DictStrategies("merge"))],
[(collections.abc.Mapping, deepmerge.strategy.dict.DictStrategies("merge"))],
["override"],
["override"],
).merge
Expand Down

0 comments on commit 4f6bc2e

Please sign in to comment.