diff options
| author | 93578237 <43147888+93578237@users.noreply.github.com> | 2026-02-09 16:06:50 -0500 |
|---|---|---|
| committer | Jacob Walls <jacobtylerwalls@gmail.com> | 2026-02-10 16:51:55 -0500 |
| commit | 56ed37e17e5b1a509aa68a0c797dcff34fcc1366 (patch) | |
| tree | d1f91ee3a83506992ccbd7994636e9b8d68314e9 /django/template | |
| parent | 2c2d36376a0ce0edc048c077a60be6e3b953bb09 (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/template')
| -rw-r--r-- | django/template/base.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/django/template/base.py b/django/template/base.py index d6595e38e7..9d75111e42 100644 --- a/django/template/base.py +++ b/django/template/base.py @@ -60,7 +60,7 @@ from django.template.context import BaseContext from django.utils.deprecation import django_file_prefixes from django.utils.formats import localize from django.utils.html import conditional_escape -from django.utils.inspect import lazy_annotations +from django.utils.inspect import lazy_annotations, signature from django.utils.regex_helper import _lazy_re_compile from django.utils.safestring import SafeData, SafeString, mark_safe from django.utils.text import get_text_list, smart_split, unescape_string_literal @@ -1000,12 +1000,12 @@ class Variable: current = current() except TypeError: try: - signature = inspect.signature(current) + current_signature = signature(current) except ValueError: # No signature found. current = context.template.engine.string_if_invalid else: try: - signature.bind() + current_signature.bind() except TypeError: # Arguments *were* required. # Invalid method call. current = context.template.engine.string_if_invalid |
