mirror of https://github.com/django/django.git
Used full module import for inspect in template/base.py.
This commit is contained in:
parent
d6505273cd
commit
23af086665
|
@ -50,10 +50,10 @@ times with multiple contexts)
|
||||||
'<html></html>'
|
'<html></html>'
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import inspect
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from inspect import getcallargs, getfullargspec, unwrap
|
|
||||||
|
|
||||||
from django.template.context import BaseContext
|
from django.template.context import BaseContext
|
||||||
from django.utils.formats import localize
|
from django.utils.formats import localize
|
||||||
|
@ -707,9 +707,9 @@ class FilterExpression:
|
||||||
# First argument, filter input, is implied.
|
# First argument, filter input, is implied.
|
||||||
plen = len(provided) + 1
|
plen = len(provided) + 1
|
||||||
# Check to see if a decorator is providing the real function.
|
# Check to see if a decorator is providing the real function.
|
||||||
func = unwrap(func)
|
func = inspect.unwrap(func)
|
||||||
|
|
||||||
args, _, _, defaults, _, _, _ = getfullargspec(func)
|
args, _, _, defaults, _, _, _ = inspect.getfullargspec(func)
|
||||||
alen = len(args)
|
alen = len(args)
|
||||||
dlen = len(defaults or [])
|
dlen = len(defaults or [])
|
||||||
# Not enough OR Too many
|
# Not enough OR Too many
|
||||||
|
@ -858,7 +858,7 @@ class Variable:
|
||||||
current = current()
|
current = current()
|
||||||
except TypeError:
|
except TypeError:
|
||||||
try:
|
try:
|
||||||
getcallargs(current)
|
inspect.getcallargs(current)
|
||||||
except TypeError: # arguments *were* required
|
except TypeError: # arguments *were* required
|
||||||
current = context.template.engine.string_if_invalid # invalid method call
|
current = context.template.engine.string_if_invalid # invalid method call
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue