Skip to content

Commit

Permalink
Remove workarounds for importing safearrays. (#640) (#645)
Browse files Browse the repository at this point in the history
* fmt import

* fixed import

* fmt inport statements
  • Loading branch information
newwingbird authored Nov 16, 2024
1 parent 0db045e commit e3b5e28
Showing 1 changed file with 11 additions and 20 deletions.
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

0 comments on commit e3b5e28

Please sign in to comment.