From 15a5c720b2bc6c5e61faa23c2060d00ee7f33a57 Mon Sep 17 00:00:00 2001 From: wmorrell Date: Fri, 17 Nov 2023 09:11:34 -0800 Subject: [PATCH] Fix DeprecationWarning for pkgutil.find_loader (#1623) --- django_filters/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/django_filters/__init__.py b/django_filters/__init__.py index c854b2c3..3586f660 100644 --- a/django_filters/__init__.py +++ b/django_filters/__init__.py @@ -1,14 +1,14 @@ # flake8: noqa -import pkgutil +from importlib import util as importlib_util from .filters import * from .filterset import FilterSet # We make the `rest_framework` module available without an additional import. # If DRF is not installed, no-op. -if pkgutil.find_loader("rest_framework") is not None: +if importlib_util.find_spec("rest_framework"): from . import rest_framework -del pkgutil +del importlib_util __version__ = "23.3"