Skip to content

Commit 1988519

Browse files
committed
Fixes to how singledispatch is imported
1 parent bbbf688 commit 1988519

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

graphene/contrib/django/utils.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,16 @@ def get_filtering_args_from_filterset(filterset_class, type):
5151

5252

5353
def import_single_dispatch():
54-
singledispatch = None
5554
try:
5655
from functools import singledispatch
5756
except ImportError:
58-
pass
57+
singledispatch = None
5958

60-
try:
61-
from singledispatch import singledispatch
62-
except ImportError:
63-
pass
59+
if not singledispatch:
60+
try:
61+
from singledispatch import singledispatch
62+
except ImportError:
63+
pass
6464

6565
if not singledispatch:
6666
raise Exception(

0 commit comments

Comments
 (0)