summaryrefslogtreecommitdiff
path: root/django/contrib/auth
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 17:08:13 -0500
commita4999ef1b9790a4c0e793cf0e5c464e9935c3c3a (patch)
treef40aea6d8d811cb1ea3e8babc428debd2d175675 /django/contrib/auth
parente9b85373580338c4878d3f930b52c361398065ad (diff)
[5.2.x] 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. Backport of 56ed37e17e5b1a509aa68a0c797dcff34fcc1366 from main.
Diffstat (limited to 'django/contrib/auth')
-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 84ca239558..e181cee6ae 100644
--- a/django/contrib/auth/__init__.py
+++ b/django/contrib/auth/__init__.py
@@ -1,4 +1,3 @@
-import inspect
import re
import warnings
@@ -8,6 +7,7 @@ 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.deprecation import RemovedInDjango61Warning
+from django.utils.inspect import signature
from django.utils.module_loading import import_string
from django.views.decorators.debug import sensitive_variables
@@ -42,7 +42,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: