summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_wmi.py
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2024-04-15 14:43:11 (GMT)
committerGitHub <noreply@github.com>2024-04-15 14:43:11 (GMT)
commit7d9d6b53bcee58252e38732a1fa1ca786eba4aab (patch)
tree24c5d9d1461e16db13844cbea8816314c951964e /Lib/test/test_wmi.py
parent185999bb3ad3f1484da8fa4b84813980b976dc3c (diff)
downloadcpython-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.py6
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):