summaryrefslogtreecommitdiff
path: root/django/contrib
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:54:46 -0500
commitdeac58ed822c6cd819e916e6c3d1736c7adfa31e (patch)
tree705f1e46ce13320352804c299509fcf8fa3e27af /django/contrib
parent254b30483def1fa75270de9f45ad1f2a19f39bdb (diff)
[6.0.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')
-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 d752e3172b..1119ef4f91 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: