merge: reconcile main desktop cleanup and record 1582 passing tests

This commit is contained in:
阿白叔 committed 2026-11-05 21:58:27 +08:00
commit 9a9fbce9b2
4 files changed
+218 -28

No files matched your search

+8 -4
View File
@@ -1469,13 +1469,14 @@ def read_library_flag(library, name, *, timeout_seconds=90, log_path=None):
deadline = time.monotonic() + timeout_seconds
desktop_name = 'CbbFlagRead_' + os.urandom(5).hex()
desktop = win32service.CreateDesktop(desktop_name, 0, win32con.GENERIC_ALL, None)
desktop = None
handle = None
pid = None
handled = set()
log = log_path or Path(library).parent/'LogFiles'/'cbb_flag_read_dialogs.jsonl'
try:
desktop = win32service.CreateDesktop(desktop_name, 0, win32con.GENERIC_ALL, None)
startup = win32process.STARTUPINFO()
startup.lpDesktop = 'winsta0\\' + desktop_name
handle, thread, pid, _ = win32process.CreateProcess(
@@ -1519,7 +1520,8 @@ def read_library_flag(library, name, *, timeout_seconds=90, log_path=None):
except Exception:
pass
try:
desktop.CloseDesktop()
if desktop is not None:
desktop.CloseDesktop()
except Exception:
pass
@@ -1548,12 +1550,13 @@ def read_library_tree_image_map(library, names, *, timeout_seconds=45, log_path=
if not executable.is_file():
return result
desktop_name = 'CbbStatusRead_' + os.urandom(5).hex()
desktop = win32service.CreateDesktop(desktop_name, 0, win32con.GENERIC_ALL, None)
desktop = None
handle = None
pid = None
handled = set()
log = log_path or Path(library).parent/'LogFiles'/'cbb_status_read_dialogs.jsonl'
try:
desktop = win32service.CreateDesktop(desktop_name, 0, win32con.GENERIC_ALL, None)
startup = win32process.STARTUPINFO()
startup.lpDesktop = 'winsta0\\' + desktop_name
handle, thread, pid, _ = win32process.CreateProcess(
@@ -1607,7 +1610,8 @@ def read_library_tree_image_map(library, names, *, timeout_seconds=45, log_path=
except Exception:
pass
try:
desktop.CloseDesktop()
if desktop is not None:
desktop.CloseDesktop()
except Exception:
pass