diff options
| author | Steve Dower <steve.dower@python.org> | 2024-04-15 14:43:11 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-15 14:43:11 (GMT) |
| commit | 7d9d6b53bcee58252e38732a1fa1ca786eba4aab (patch) | |
| tree | 24c5d9d1461e16db13844cbea8816314c951964e /Lib/test/test_wmi.py | |
| parent | 185999bb3ad3f1484da8fa4b84813980b976dc3c (diff) | |
| download | cpython-7d9d6b53bcee58252e38732a1fa1ca786eba4aab.zip cpython-7d9d6b53bcee58252e38732a1fa1ca786eba4aab.tar.gz cpython-7d9d6b53bcee58252e38732a1fa1ca786eba4aab.tar.bz2 | |
gh-112278: Improve error handling in wmi module and tests (GH-117818)
Diffstat (limited to 'Lib/test/test_wmi.py')
| -rw-r--r-- | Lib/test/test_wmi.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_wmi.py b/Lib/test/test_wmi.py index bf8c52e..f667926 100644 --- a/Lib/test/test_wmi.py +++ b/Lib/test/test_wmi.py @@ -14,11 +14,13 @@ def wmi_exec_query(query): # gh-112278: WMI maybe slow response when first call. try: return _wmi.exec_query(query) + except BrokenPipeError: + pass except WindowsError as e: if e.winerror != 258: raise - time.sleep(LOOPBACK_TIMEOUT) - return _wmi.exec_query(query) + time.sleep(LOOPBACK_TIMEOUT) + return _wmi.exec_query(query) class WmiTests(unittest.TestCase): |
