Skip to content

Commit 96901b1

Browse files
committed
Update to avoid a pending deprecation warning running tests
1 parent c8b009e commit 96901b1

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

com/win32com/test/util.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import tempfile
44
import unittest
55
import gc
6+
import pywintypes
67
import pythoncom
78
import winerror
89
from pythoncom import _GetInterfaceCount, _GetGatewayCount
@@ -37,18 +38,13 @@ def RegisterPythonServer(filename, progids=None, verbose=0):
3738
# exist and the DLL points at our version, assume it already is.
3839
why_not = None
3940
for progid in progids:
40-
try:
41-
clsid = pythoncom.MakeIID(progid)
42-
except pythoncom.com_error:
43-
# no progid - not registered.
44-
break
45-
# have a CLSID - open it.
41+
clsid = pywintypes.IID(progid)
4642
try:
4743
HKCR = _winreg.HKEY_CLASSES_ROOT
4844
hk = _winreg.OpenKey(HKCR, "CLSID\\%s" % clsid)
4945
dll = _winreg.QueryValue(hk, "InprocServer32")
5046
except WindowsError:
51-
# no CLSID or InProcServer32 - not good!
47+
# no CLSID or InProcServer32 - not registered
5248
break
5349
ok_files = [os.path.basename(pythoncom.__file__),
5450
'pythoncomloader%d%d.dll' % (sys.version_info[0], sys.version_info[1])]

0 commit comments

Comments
 (0)