mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Used Signature API instead of deprecated inspect.getcallargs().
inspect.getcallargs() was deprecated in Python 3.5 and the Signature API (PEP 362) has better support for decorated functions (by default, it follows the __wrapped__ attribute set by functools.wraps for example).
This commit is contained in:
committed by
Mariusz Felisiak
parent
3df3c5e670
commit
09341856ed
@@ -1916,9 +1916,8 @@ class Query(BaseExpression):
|
||||
group_by = list(self.select)
|
||||
if self.annotation_select:
|
||||
for alias, annotation in self.annotation_select.items():
|
||||
try:
|
||||
inspect.getcallargs(annotation.get_group_by_cols, alias=alias)
|
||||
except TypeError:
|
||||
signature = inspect.signature(annotation.get_group_by_cols)
|
||||
if 'alias' not in signature.parameters:
|
||||
annotation_class = annotation.__class__
|
||||
msg = (
|
||||
'`alias=None` must be added to the signature of '
|
||||
|
||||
Reference in New Issue
Block a user