From 95c8699581a7691496153d77fbdcb2c3e24172db Mon Sep 17 00:00:00 2001 From: Elizaveta Shashkova Date: Thu, 27 Oct 2016 17:11:40 +0300 Subject: [PATCH] Clear exception information in Python 2 (PY-21215) It's needed for example for celery's retry for task. The fix suggested by Krzysztof Nazarewski. --- python/helpers/pydev/pydevd.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python/helpers/pydev/pydevd.py b/python/helpers/pydev/pydevd.py index ee42fb00294a..e7b11abdcd39 100644 --- a/python/helpers/pydev/pydevd.py +++ b/python/helpers/pydev/pydevd.py @@ -1544,7 +1544,11 @@ if __name__ == '__main__': from _pydevd_bundle import pydevd_stackless pydevd_stackless.patch_stackless() except: - pass # It's ok not having stackless there... + # It's ok not having stackless there... + try: + sys.exc_clear() # the exception information should be cleaned in Python 2 + except: + pass is_module = setup['module'] patch_stdin(debugger)