Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove workarounds for importing safearrays. (#640) #645

Merged
merged 3 commits into from
Nov 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 11 additions & 20 deletions comtypes/automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,26 @@
import decimal
import sys
from ctypes import *
from ctypes import _Pointer, Array as _CArrayType
from _ctypes import CopyComPointer
from ctypes import Array as _CArrayType
from ctypes import _Pointer
from ctypes.wintypes import DWORD, LONG, UINT, VARIANT_BOOL, WCHAR, WORD
from typing import Any, ClassVar, Dict, List, Optional, TYPE_CHECKING, Type
from typing import TYPE_CHECKING, Any, ClassVar, Dict, List, Optional, Type

from _ctypes import COMError, CopyComPointer

from comtypes import _CData, BSTR, COMError, COMMETHOD, GUID, IID, IUnknown, STDMETHOD
from comtypes.hresult import *
from comtypes._memberspec import _DispMemberSpec
import comtypes.patcher
import comtypes
import comtypes.patcher
from comtypes import BSTR, COMMETHOD, GUID, IID, STDMETHOD, IUnknown, _CData, _safearray
from comtypes._memberspec import _DispMemberSpec
from comtypes.hresult import *
from comtypes.safearray import _midlSAFEARRAY

if TYPE_CHECKING:
from ctypes import _CArgObject

from comtypes import hints # type: ignore
from comtypes import _safearray
else:
_CArgObject = type(byref(c_int()))
try:
from comtypes import _safearray
except (ImportError, AttributeError):

class _safearray(object):
tagSAFEARRAY = None


LCID = DWORD
Expand Down Expand Up @@ -991,12 +988,6 @@ def Invoke(self, dispid: int, *args: Any, **kw: Any) -> Any:
_ctype_to_vartype[c_char] = VT_UI1


try:
from comtypes.safearray import _midlSAFEARRAY
except (ImportError, AttributeError):
pass


# fmt: off
__known_symbols__ = [
"CURRENCY", "CY", "tagCY", "DECIMAL", "tagDEC", "DISPATCH_METHOD",
Expand Down