Skip to content

Instantly share code, notes, and snippets.

@alexkasko
Created September 6, 2014 22:08
Show Gist options
  • Save alexkasko/e78e3b9fc70590207c67 to your computer and use it in GitHub Desktop.
Save alexkasko/e78e3b9fc70590207c67 to your computer and use it in GitHub Desktop.
--- base.py 2014-09-06 22:50:21.391493603 +0100
+++ base_getcallargs_patched.py 2014-09-06 22:49:47.043494548 +0100
@@ -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
@@ -788,6 +789,10 @@
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment