From 832c79280831b65a544b8aa49f4839b1e3663c02 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 15 Oct 2024 20:52:19 -0400 Subject: [PATCH] src/sage/doctest/forker.py: remove old python 2 workaround According to the comment, we can skip clearing this exception nowadays because we only support python3. --- src/sage/doctest/forker.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/sage/doctest/forker.py b/src/sage/doctest/forker.py index 18bab126bb0..8bddadc1f48 100644 --- a/src/sage/doctest/forker.py +++ b/src/sage/doctest/forker.py @@ -716,16 +716,6 @@ def compiler(example): raise except BaseException: exception = sys.exc_info() - # On Python 2, the exception lives in sys.exc_info() as - # long we are in the same stack frame. To ensure that - # sig_occurred() works correctly, we need to clear the - # exception. This is not an issue on Python 3, where the - # exception is cleared as soon as we are outside of the - # "except" clause. - try: - sys.exc_clear() - except AttributeError: - pass # Python 3 finally: if self.debugger is not None: self.debugger.set_continue() # ==== Example Finished ====