WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 09ff68b

Browse files
committed
win_driver_utils: ignore uninstall of missing driver
Sometimes the drivers aren't installed, it will lead to test case failed in the driver uninstall function. Assisted-by: Claude. 80%. Signed-off-by: Xiaoling Gao <[email protected]>
1 parent e91fe7f commit 09ff68b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

provider/win_driver_utils.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,13 @@ def uninstall_driver(session, test, devcon_path, driver_name, device_name, devic
9696
inf_list_all = _pnpdrv_info(session, device_name, ["InfName"])
9797
inf_list = list(set(inf_list_all))
9898

99+
# Check if any drivers were found
100+
if not inf_list:
101+
LOG_JOB.warning(
102+
"No driver found for device '%s', driver may not installed.", device_name
103+
)
104+
return
105+
99106
# pnputil flags available starting in Windows 10,
100107
# version 1607, build 14393 later
101108
build_ver = system.version(session).split(".")[2]

0 commit comments

Comments
 (0)