From e4cf09527bce7569f5db742cf6ae9db68d50c6a9 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 18 Nov 2024 12:00:38 +1100 Subject: [PATCH] unittest: Always use "raise" with an argument. So this code can be compiled with the MicroPython native emitter, which does not support "raise" without any arguments. Signed-off-by: Damien George --- python-stdlib/unittest/manifest.py | 2 +- python-stdlib/unittest/unittest/__init__.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python-stdlib/unittest/manifest.py b/python-stdlib/unittest/manifest.py index 101e3e833..a01bbb8e6 100644 --- a/python-stdlib/unittest/manifest.py +++ b/python-stdlib/unittest/manifest.py @@ -1,3 +1,3 @@ -metadata(version="0.10.3") +metadata(version="0.10.4") package("unittest") diff --git a/python-stdlib/unittest/unittest/__init__.py b/python-stdlib/unittest/unittest/__init__.py index 6d7fa40b8..61b315788 100644 --- a/python-stdlib/unittest/unittest/__init__.py +++ b/python-stdlib/unittest/unittest/__init__.py @@ -198,7 +198,7 @@ def assertRaises(self, exc, func=None, *args, **kwargs): except Exception as e: if isinstance(e, exc): return - raise + raise e assert False, "%r not raised" % exc @@ -407,7 +407,7 @@ def run_one(test_function): current_test=(name, c), test_result=test_result, exc_info=(type(ex), ex, None) ) # Uncomment to investigate failure in detail - # raise + # raise ex finally: __test_result__ = None __current_test__ = None