diff options
| author | Tim Graham <timograham@gmail.com> | 2015-06-10 17:24:04 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-10-25 06:02:21 -0400 |
| commit | e2ea30c4403fca1b0a2032aae7a783f8705fc08b (patch) | |
| tree | 3f4f39f8422db192425cdde82d1af1344df5fc22 /django/template | |
| parent | 84ec3bfc1111525ee0b21afff870840b2eb13771 (diff) | |
[1.8.x] Fixed #24979 -- Removed usage of inspect.getargspec().
Backport of 3872a33132a4bb6aa22b237927597bbfdf6f21d7 from master
Diffstat (limited to 'django/template')
| -rw-r--r-- | django/template/base.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/django/template/base.py b/django/template/base.py index 5661bdc000..79c8a482e8 100644 --- a/django/template/base.py +++ b/django/template/base.py @@ -51,11 +51,11 @@ u'<html></html>' from __future__ import unicode_literals +import inspect import re import warnings from functools import partial from importlib import import_module -from inspect import getargspec, getcallargs from django.apps import apps from django.template.context import ( # NOQA: imported for backwards compatibility @@ -68,6 +68,7 @@ from django.utils.encoding import ( ) from django.utils.formats import localize from django.utils.html import conditional_escape +from django.utils.inspect import getargspec from django.utils.itercompat import is_iterable from django.utils.module_loading import module_has_submodule from django.utils.safestring import ( @@ -686,7 +687,8 @@ class FilterExpression(object): plen = len(provided) + 1 # Check to see if a decorator is providing the real function. func = getattr(func, '_decorated_function', func) - args, varargs, varkw, defaults = getargspec(func) + + args, _, _, defaults = getargspec(func) alen = len(args) dlen = len(defaults or []) # Not enough OR Too many @@ -847,7 +849,7 @@ class Variable(object): current = current() except TypeError: try: - getcallargs(current) + inspect.getcallargs(current) except TypeError: # arguments *were* required current = context.template.engine.string_if_invalid # invalid method call else: |
