Skip to content

Commit c24e054

Browse files
author
Rami Chowdhury
committed
Fix OrderedDict import from typing
1 parent 06ee2ee commit c24e054

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

graphene_pydantic/converters.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,9 @@ def convert_generic_python_type(
166166
# first of the wrapped types
167167
inner_type = inner_types[0]
168168
return List(find_graphene_type(inner_type, field, registry))
169-
elif origin in (
170-
T.Dict,
171-
T.OrderedDict,
172-
T.Mapping,
173-
collections.OrderedDict,
174-
dict,
175-
) or issubclass(origin, abc.Mapping):
169+
elif origin in (T.Dict, T.Mapping, collections.OrderedDict, dict) or issubclass(
170+
origin, abc.Mapping
171+
):
176172
raise ConversionError("Don't know how to handle mappings in Graphene")
177173
else:
178174
raise ConversionError(f"Don't know how to handle {type_} (generic: {origin})")

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
dev_requirements = [
1111
"tox==3.7.0", # Should be kept in sync with tox.ini
12-
"mypy==0.701",
12+
"mypy==0.720",
1313
"black==19.3b0",
1414
"pre-commit==1.14.4",
1515
]

0 commit comments

Comments
 (0)