summaryrefslogtreecommitdiff
path: root/django/contrib/auth/__init__.py
diff options
context:
space:
mode:
author93578237 <43147888+93578237@users.noreply.github.com>2026-02-09 16:06:50 -0500
committerJacob Walls <jacobtylerwalls@gmail.com>2026-02-10 16:51:55 -0500
commit56ed37e17e5b1a509aa68a0c797dcff34fcc1366 (patch)
treed1f91ee3a83506992ccbd7994636e9b8d68314e9 /django/contrib/auth/__init__.py
parent2c2d36376a0ce0edc048c077a60be6e3b953bb09 (diff)
Fixed #36903 -- Fixed further NameErrors when inspecting functions with deferred annotations.
Provide a wrapper for safe introspection of user functions on Python 3.14+. Follow-up to 601914722956cc41f1f2c53972d669ddee6ffc04.
Diffstat (limited to 'django/contrib/auth/__init__.py')
-rw-r--r--django/contrib/auth/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/contrib/auth/__init__.py b/django/contrib/auth/__init__.py
index 8a0bcb7420..2702c38aa4 100644
--- a/django/contrib/auth/__init__.py
+++ b/django/contrib/auth/__init__.py
@@ -1,4 +1,3 @@
-import inspect
import re
from django.apps import apps as django_apps
@@ -6,6 +5,7 @@ from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.middleware.csrf import rotate_token
from django.utils.crypto import constant_time_compare
+from django.utils.inspect import signature
from django.utils.module_loading import import_string
from django.views.decorators.debug import sensitive_variables
@@ -40,7 +40,7 @@ def get_backends():
def _get_compatible_backends(request, **credentials):
for backend, backend_path in _get_backends(return_tuples=True):
- backend_signature = inspect.signature(backend.authenticate)
+ backend_signature = signature(backend.authenticate)
try:
backend_signature.bind(request, **credentials)
except TypeError: