Skip to content

Commit

Permalink
correcting type hint for CreateObject (enthought#470)
Browse files Browse the repository at this point in the history
Co-authored-by: jonschz <jonschz@users.noreply.github.com>
  • Loading branch information
jonschz and jonschz authored Jan 15, 2023
1 parent a76f0b1 commit 1615af5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions comtypes/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,13 @@ def GetClassObject(progid, clsctx=None, pServerInfo=None, interface=None):


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


@overload
def CreateObject(
progid: _UnionT[str, CoClass, GUID],
progid: _UnionT[str, Type[CoClass], GUID],
clsctx: Optional[int] = None,
machine: Optional[str] = None,
interface: Optional[Type[_T_IUnknown]] = None,
Expand All @@ -240,7 +240,7 @@ def CreateObject(


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

0 comments on commit 1615af5

Please sign in to comment.