Skip to content

Commit 9385467

Browse files
jonschzjunkmd
authored andcommitted
correcting type hint for CreateObject (enthought#470)
Co-authored-by: jonschz <[email protected]> (cherry picked from commit 1615af5)
1 parent d384eeb commit 9385467

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

comtypes/client/__init__.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -223,13 +223,13 @@ def GetClassObject(progid, clsctx=None, pServerInfo=None, interface=None):
223223

224224

225225
@overload
226-
def CreateObject(progid: _UnionT[str, CoClass, GUID]) -> Any:
226+
def CreateObject(progid: _UnionT[str, Type[CoClass], GUID]) -> Any:
227227
...
228228

229229

230230
@overload
231231
def CreateObject(
232-
progid: _UnionT[str, CoClass, GUID],
232+
progid: _UnionT[str, Type[CoClass], GUID],
233233
clsctx: Optional[int] = None,
234234
machine: Optional[str] = None,
235235
interface: Optional[Type[_T_IUnknown]] = None,
@@ -240,7 +240,7 @@ def CreateObject(
240240

241241

242242
def CreateObject(
243-
progid: _UnionT[str, CoClass, GUID], # which object to create
243+
progid: _UnionT[str, Type[CoClass], GUID], # which object to create
244244
clsctx: Optional[int] = None, # how to create the object
245245
machine: Optional[str] = None, # where to create the object
246246
interface: Optional[Type[IUnknown]] = None, # the interface we want
@@ -289,7 +289,7 @@ def CreateObject(
289289
pServerInfo,
290290
)
291291
if machine is not None and pServerInfo is not None:
292-
msg = "You can notset both the machine name and server info."
292+
msg = "You cannot set both the machine name and server info."
293293
raise ValueError(msg)
294294
obj = comtypes.CoCreateInstanceEx(
295295
clsid,

0 commit comments

Comments
 (0)