Skip to content

Commit

Permalink
[1.7.x] Fixed #23111 -- Do not try to import getcallargs on Jython
Browse files Browse the repository at this point in the history
  • Loading branch information
beachmachine committed Jul 27, 2014
1 parent df0d5ea commit 1c6104c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion django/template/base.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from __future__ import unicode_literals

import re
import sys
from functools import partial
from importlib import import_module
from inspect import getargspec, getcallargs
from inspect import getargspec

from django.apps import apps
from django.conf import settings
Expand Down Expand Up @@ -788,6 +789,10 @@ def _resolve_lookup(self, context):
current = current()
except TypeError:
try:
# `getcallargs` not available on Jython
if sys.platform.startswith('java'):
raise
from inspect import getcallargs
getcallargs(current)
except TypeError: # arguments *were* required
current = settings.TEMPLATE_STRING_IF_INVALID # invalid method call
Expand Down

0 comments on commit 1c6104c

Please sign in to comment.