From eba0b24331fdc2a06fee0e0170d6b2d103ad6677 Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Sun, 10 Sep 2023 10:27:54 -0500 Subject: [PATCH] Resolve a Python 3.12 `DeprecationWarning` --- tests/conftest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 2ede2e5..162781b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -219,7 +219,10 @@ def root(standardize_tmp): finally: [patch.stop() for patch in patches] os.chdir(current_working_directory) - rmtree(current_root, onerror=rmtree_error_handler) + if sys.version_info >= (3, 12): + rmtree(current_root, onexc=rmtree_error_handler) + else: + rmtree(current_root, onerror=rmtree_error_handler) @pytest.fixture