diff --git a/comtypes/__init__.py b/comtypes/__init__.py index 7ed3337b..78b69d8a 100644 --- a/comtypes/__init__.py +++ b/comtypes/__init__.py @@ -35,7 +35,6 @@ else: _CData = _SimpleCData.__mro__[:-1][-1] -from comtypes.GUID import GUID from comtypes import patcher # noqa from comtypes._npsupport import interop as npsupport # noqa from comtypes._tlib_version_checker import _check_version # noqa @@ -73,8 +72,6 @@ class ReturnHRESULT(Exception): # class IDLWarning(UserWarning): # "Warn about questionable type information" -_GUID = GUID -IID = GUID DWORD = c_ulong wireHWND = c_ulong @@ -182,7 +179,10 @@ def CoUninitialize(): ################################################################ from comtypes._post_coinit.bstr import BSTR # noqa +from comtypes._post_coinit.guid import GUID +_GUID = GUID +IID = GUID ################################################################ # IPersist is a trivial interface, which allows to ask an object about diff --git a/comtypes/_memberspec.py b/comtypes/_memberspec.py index 5d950cc8..bb7a795e 100644 --- a/comtypes/_memberspec.py +++ b/comtypes/_memberspec.py @@ -360,7 +360,7 @@ def to_propputref_keys(self, m: _DispMemberSpec) -> Tuple[str, _DocType, int]: class ComMemberGenerator(object): - def __init__(self, cls_name: str, vtbl_offset: int, iid: comtypes.GUID) -> None: + def __init__(self, cls_name: str, vtbl_offset: int, iid: "comtypes.GUID") -> None: self._vtbl_offset = vtbl_offset self._iid = iid self._props = ComPropertyGenerator(cls_name) diff --git a/comtypes/GUID.py b/comtypes/_post_coinit/guid.py similarity index 100% rename from comtypes/GUID.py rename to comtypes/_post_coinit/guid.py diff --git a/comtypes/_post_coinit/misc.py b/comtypes/_post_coinit/misc.py index 9f811cc6..7fa865b3 100644 --- a/comtypes/_post_coinit/misc.py +++ b/comtypes/_post_coinit/misc.py @@ -15,11 +15,11 @@ if TYPE_CHECKING: from comtypes import hints as hints # noqa # type: ignore -from comtypes import GUID from comtypes._idl_stuff import COMMETHOD # noqa from comtypes import CLSCTX_SERVER, CLSCTX_LOCAL_SERVER, CLSCTX_REMOTE_SERVER from comtypes import _ole32, oledll, DWORD from comtypes._post_coinit.unknwn import IUnknown +from comtypes._post_coinit.guid import GUID def _is_object(obj): diff --git a/comtypes/_post_coinit/unknwn.py b/comtypes/_post_coinit/unknwn.py index 3b345489..b3177699 100644 --- a/comtypes/_post_coinit/unknwn.py +++ b/comtypes/_post_coinit/unknwn.py @@ -7,11 +7,12 @@ from typing import Optional from typing import List, Type -from comtypes import GUID, _ole32_nohresult, com_interface_registry +from comtypes import _ole32_nohresult, com_interface_registry from comtypes._idl_stuff import STDMETHOD from comtypes._memberspec import ComMemberGenerator, DispMemberGenerator from comtypes._memberspec import _ComMemberSpec, _DispMemberSpec from comtypes._post_coinit import _cominterface_meta_patcher as _meta_patch +from comtypes._post_coinit.guid import GUID from comtypes._py_instance_method import instancemethod logger = logging.getLogger(__name__)