Skip to content

Commit 21b33aa

Browse files
authored
Fix deprecation warnings in tests (#2567)
1 parent 25e01da commit 21b33aa

File tree

7 files changed

+12
-7
lines changed

7 files changed

+12
-7
lines changed

com/win32com/client/combrowse.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import sys
2727

2828
import pythoncom
29+
import pywintypes
2930
import win32api
3031
import win32con
3132
import win32ui
@@ -61,7 +62,7 @@ def CalculateIsExpandable(self):
6162
class HLICLSID(HLICOM):
6263
def __init__(self, myobject, name=None):
6364
if isinstance(myobject, str):
64-
myobject = pythoncom.MakeIID(myobject)
65+
myobject = pywintypes.IID(myobject)
6566
if name is None:
6667
try:
6768
name = pythoncom.ProgIDFromCLSID(myobject)

com/win32com/demos/connect.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
# is cheated on - so this is still working as a fully-fledged server.
77

88
import pythoncom
9+
import pywintypes
910
import win32com.server.connect
1011
import win32com.server.util
1112

1213
# This is the IID of the Events interface both Client and Server support.
13-
IID_IConnectDemoEvents = pythoncom.MakeIID("{A4988850-49C3-11d0-AE5D-52342E000000}")
14+
IID_IConnectDemoEvents = pywintypes.IID("{A4988850-49C3-11d0-AE5D-52342E000000}")
1415

1516
# The server which implements
1617
# Create a connectable class, that has a single public method

com/win32com/server/policy.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ def _wrap_(self, object):
257257
if i[0] != "{":
258258
i = pythoncom.InterfaceNames[i]
259259
else:
260-
i = pythoncom.MakeIID(i)
260+
i = pywintypes.IID(i)
261261
self._com_interfaces_.append(i)
262262
else:
263263
self._com_interfaces_ = []

com/win32com/test/testDynamic.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# Test dynamic policy, and running object table.
22

33
import pythoncom
4+
import pywintypes
45
import winerror
56
from win32com.server.exception import COMException
67

7-
iid = pythoncom.MakeIID("{b48969a0-784b-11d0-ae71-d23f56000000}")
8+
iid = pywintypes.IID("{b48969a0-784b-11d0-ae71-d23f56000000}")
89

910

1011
class VeryPermissive:

com/win32com/test/testShell.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def testSimpleUnicode(self):
151151
self._testSimple(True)
152152

153153
def testComplex(self):
154-
clsid = pythoncom.MakeIID("{CD637886-DB8B-4b04-98B5-25731E1495BE}")
154+
clsid = pywintypes.IID("{CD637886-DB8B-4b04-98B5-25731E1495BE}")
155155
ctime, atime, wtime = self._getTestTimes()
156156
d = {
157157
"cFileName": "foo.txt",

com/win32comext/axscript/test/leakTest.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import sys
22

33
import pythoncom
4+
import pywintypes
45
from win32com.axscript import axscript
56
from win32com.axscript.server import axsite
67
from win32com.server import connect, util
@@ -53,7 +54,7 @@ def echo(self, *args):
5354
#### Connections currently won't work, as there is no way for the engine to
5455
#### know what events we support. We need typeinfo support.
5556

56-
IID_ITestEvents = pythoncom.MakeIID("{8EB72F90-0D44-11d1-9C4B-00AA00125A98}")
57+
IID_ITestEvents = pywintypes.IID("{8EB72F90-0D44-11d1-9C4B-00AA00125A98}")
5758

5859

5960
class TestConnectServer(connect.ConnectableServer):

com/win32comext/axscript/test/testHost.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import unittest
33

44
import pythoncom
5+
import pywintypes
56
import win32com.server.policy
67
import win32com.test.util
78
from win32com.axscript import axscript
@@ -72,7 +73,7 @@ def fail(self, *args):
7273
#### Connections currently won't work, as there is no way for the engine to
7374
#### know what events we support. We need typeinfo support.
7475

75-
IID_ITestEvents = pythoncom.MakeIID("{8EB72F90-0D44-11d1-9C4B-00AA00125A98}")
76+
IID_ITestEvents = pywintypes.IID("{8EB72F90-0D44-11d1-9C4B-00AA00125A98}")
7677

7778

7879
class TestConnectServer(connect.ConnectableServer):

0 commit comments

Comments
 (0)