diff options
author | Markus Unterwaditzer <markus@unterwaditzer.net> | 2015-04-02 01:52:52 +0200 |
---|---|---|
committer | Markus Unterwaditzer <markus@unterwaditzer.net> | 2015-04-02 01:52:52 +0200 |
commit | 1ae49941f8d2c4cb88a8cb952d095a7b1e1a90fe (patch) | |
tree | 0a8996e297b2574b91f3ce6016b4326adab29af9 | |
parent | a1f76f92a182e3afbd7e9d221cf7ece8b89649a6 (diff) | |
download | jinja2-1ae49941f8d2c4cb88a8cb952d095a7b1e1a90fe.tar.gz |
Fix #433
-rw-r--r-- | jinja2/_compat.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/jinja2/_compat.py b/jinja2/_compat.py index 8fa8a49..7f10316 100644 --- a/jinja2/_compat.py +++ b/jinja2/_compat.py @@ -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 |