From 2c9fc3d63ef9c897e508d1b944e31849dbf9abaa Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 13 Oct 2024 01:18:49 +0900 Subject: [PATCH] Drop deprecated onerror The onerror argument of the shutil.rmtree function was deprecated in Python 3.12 . Because the current value matches the actual default of the function, drop the usage. [1] https://docs.python.org/3/library/shutil.html#shutil.rmtree ``` Changed in version 3.12: Added the onexc parameter, deprecated onerror. ``` Change-Id: I78e32a520a8c7787ad3c8b79b605917648f7e6d8 --- .../unit/accelerator/drivers/fpga/intel/prepare_test_data.py | 2 +- .../unit/accelerator/drivers/nic/intel/prepare_test_data.py | 2 +- .../unit/accelerator/drivers/qat/intel/prepare_test_data.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cyborg/tests/unit/accelerator/drivers/fpga/intel/prepare_test_data.py b/cyborg/tests/unit/accelerator/drivers/fpga/intel/prepare_test_data.py index ecfd2bb2..68bd548c 100755 --- a/cyborg/tests/unit/accelerator/drivers/fpga/intel/prepare_test_data.py +++ b/cyborg/tests/unit/accelerator/drivers/fpga/intel/prepare_test_data.py @@ -277,7 +277,7 @@ def create_fake_sysfs(prefix=""): sys_class_fpga = os.path.join(prefix, SYS_CLASS_FPGA) basedir = os.path.dirname(sys_device) if os.path.exists(basedir): - shutil.rmtree(basedir, ignore_errors=False, onerror=None) + shutil.rmtree(basedir, ignore_errors=False) os.makedirs(sys_class_fpga) create_devices_path_and_files(FPGA_TREE, sys_device, sys_class_fpga) create_devices_soft_link(sys_class_fpga) diff --git a/cyborg/tests/unit/accelerator/drivers/nic/intel/prepare_test_data.py b/cyborg/tests/unit/accelerator/drivers/nic/intel/prepare_test_data.py index 124c4782..cd42bfea 100644 --- a/cyborg/tests/unit/accelerator/drivers/nic/intel/prepare_test_data.py +++ b/cyborg/tests/unit/accelerator/drivers/nic/intel/prepare_test_data.py @@ -241,5 +241,5 @@ def create_fake_sysfs(prefix=""): sys_device = os.path.join(prefix, SYS_DEVICES) basedir = os.path.dirname(sys_device) if os.path.exists(basedir): - shutil.rmtree(basedir, ignore_errors=False, onerror=None) + shutil.rmtree(basedir, ignore_errors=False) create_devices_path_and_files(NIC_TREE, sys_device) diff --git a/cyborg/tests/unit/accelerator/drivers/qat/intel/prepare_test_data.py b/cyborg/tests/unit/accelerator/drivers/qat/intel/prepare_test_data.py index 0a1cd34b..268f6174 100755 --- a/cyborg/tests/unit/accelerator/drivers/qat/intel/prepare_test_data.py +++ b/cyborg/tests/unit/accelerator/drivers/qat/intel/prepare_test_data.py @@ -242,7 +242,7 @@ def create_fake_sysfs(prefix=""): sys_device = os.path.join(prefix, SYS_DEVICES) basedir = os.path.dirname(sys_device) if os.path.exists(basedir): - shutil.rmtree(basedir, ignore_errors=False, onerror=None) + shutil.rmtree(basedir, ignore_errors=False) create_devices_path_and_files(QAT_TREE, sys_device)