]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Fix #433
authorMarkus Unterwaditzer <markus@unterwaditzer.net>
Wed, 1 Apr 2015 23:52:52 +0000 (01:52 +0200)
committerMarkus Unterwaditzer <markus@unterwaditzer.net>
Wed, 1 Apr 2015 23:52:52 +0000 (01:52 +0200)
jinja2/_compat.py

index 8fa8a49a0a22c22d3b58e23daacca4a163c365c8..7f10316c1ffb6a620907e43c7894e273e6417e38 100644 (file)
@@ -127,13 +127,16 @@ function_type = type(_func)
 generator_type = type(_func())
 method_type = type(_C().method)
 code_type = type(_C.method.__code__)
-try:
-    raise TypeError()
-except TypeError:
-    _tb = sys.exc_info()[2]
-    traceback_type = type(_tb)
-    frame_type = type(_tb.tb_frame)
 
+def _get_tbtype():
+    try:
+        raise TypeError()
+    except TypeError:
+        _tb = sys.exc_info()[2]
+        return type(_tb), type(_tb.tb_frame)
+
+traceback_type, frame_type = _get_tbtype()
+del _get_tbtype()
 
 try:
     from urllib.parse import quote_from_bytes as url_quote