From 17889ceef4dca0e21d673e68e19bd149d3896040 Mon Sep 17 00:00:00 2001 From: Alexandre Detiste Date: Sun, 15 Sep 2024 15:21:54 +0200 Subject: [PATCH 1/2] remove dead code: singledispatch has been in the stard library for many years (BTW this function does not seems to be used anywhere anymore) --- graphene_django/utils/utils.py | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/graphene_django/utils/utils.py b/graphene_django/utils/utils.py index 364eff9b4..e4eae7d81 100644 --- a/graphene_django/utils/utils.py +++ b/graphene_django/utils/utils.py @@ -111,25 +111,7 @@ def is_valid_django_model(model): def import_single_dispatch(): - try: - from functools import singledispatch - except ImportError: - singledispatch = None - - if not singledispatch: - try: - from singledispatch import singledispatch - except ImportError: - pass - - if not singledispatch: - raise Exception( - "It seems your python version does not include " - "functools.singledispatch. Please install the 'singledispatch' " - "package. More information here: " - "https://pypi.python.org/pypi/singledispatch" - ) - + from functools import singledispatch return singledispatch From 6cb700d888d26e6a3b7f244db9130536c7571d14 Mon Sep 17 00:00:00 2001 From: Alexandre Detiste Date: Sun, 15 Sep 2024 16:28:43 +0200 Subject: [PATCH 2/2] lint --- graphene_django/utils/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/graphene_django/utils/utils.py b/graphene_django/utils/utils.py index e4eae7d81..5f84a1716 100644 --- a/graphene_django/utils/utils.py +++ b/graphene_django/utils/utils.py @@ -112,6 +112,7 @@ def is_valid_django_model(model): def import_single_dispatch(): from functools import singledispatch + return singledispatch