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 17:08:13 -0500 |
| commit | a4999ef1b9790a4c0e793cf0e5c464e9935c3c3a (patch) | |
| tree | f40aea6d8d811cb1ea3e8babc428debd2d175675 /django/db | |
| parent | e9b85373580338c4878d3f930b52c361398065ad (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/db')
| -rw-r--r-- | django/db/models/expressions.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/models/expressions.py b/django/db/models/expressions.py index 4284c84375..f830df82c2 100644 --- a/django/db/models/expressions.py +++ b/django/db/models/expressions.py @@ -1,7 +1,6 @@ import copy import datetime import functools -import inspect from collections import defaultdict from decimal import Decimal from enum import Enum @@ -17,6 +16,7 @@ from django.db.models.query_utils import Q from django.utils.deconstruct import deconstructible from django.utils.functional import cached_property, classproperty from django.utils.hashable import make_hashable +from django.utils.inspect import signature class SQLiteNumericMixin: @@ -521,7 +521,7 @@ class Expression(BaseExpression, Combinable): @classproperty @functools.lru_cache(maxsize=128) def _constructor_signature(cls): - return inspect.signature(cls.__init__) + return signature(cls.__init__) @classmethod def _identity(cls, value): |
