Improved pywin32 error and exception classes (#11613)

This commit is contained in:
Avasam
2024-03-18 16:17:30 -04:00
committed by GitHub
parent cc5f23ac14
commit 57dee8fd5b
5 changed files with 15 additions and 16 deletions

View File

@@ -2409,7 +2409,6 @@ class SERVICE_STATUS:
class TRACKMOUSEEVENT: ...
class WIN32_FIND_DATA: ...
class com_error: ...
class connection:
def setautocommit(self, c, /) -> None: ...
@@ -2427,8 +2426,6 @@ class cursor:
def setinputsizes(self) -> None: ...
def setoutputsize(self) -> None: ...
class error(Exception): ...
class COMPONENT:
@property
def ID(self): ...

View File

@@ -2,8 +2,8 @@ from _typeshed import Incomplete
from collections.abc import Iterable
import _win32typing
from win32.lib.pywintypes import error as error
error: Incomplete
langid: Incomplete
def AddSourceToRegistry(

View File

@@ -40,6 +40,6 @@ class Query(BaseQuery):
def collectdatawhile_slave(self, period) -> None: ...
def __getinitargs__(self): ...
class QueryError(Exception):
class QueryError:
query: Incomplete
def __init__(self, query) -> None: ...

View File

@@ -1,13 +1,11 @@
from _typeshed import Incomplete
from typing import Literal
from typing_extensions import TypeAlias
from typing import ClassVar, Literal
import _win32typing
def odbc(connectionString: str, /) -> _win32typing.connection: ...
def SQLDataSources(direction, /) -> tuple[Incomplete, Incomplete]: ...
_odbcError: TypeAlias = type # noqa: Y042 # Does not exist at runtime, but odbc.odbcError is a valid type.
DATE: str
NUMBER: str
RAW: str
@@ -21,10 +19,14 @@ SQL_FETCH_PRIOR: int
SQL_FETCH_RELATIVE: int
STRING: str
TYPES: tuple[Literal["STRING"], Literal["RAW"], Literal["NUMBER"], Literal["DATE"]]
dataError: Incomplete
error: _odbcError
integrityError: Incomplete
internalError: Incomplete
noError: Incomplete
opError: Incomplete
progError: Incomplete
class error(Exception):
__name__: ClassVar[str] = "odbcError"
# These all pretend to come from a module called "dbi", but that module doesn't exist
class dataError(Exception): ...
class integrityError(Exception): ...
class internalError(Exception): ...
class noError(Exception): ...
class opError(Exception): ...
class progError(Exception): ...

View File

@@ -13,7 +13,7 @@ from win32com.server.exception import COMException as COMException
S_OK: int
IDispatchType: Incomplete
IUnknownType: Incomplete
error: Incomplete
error: str
regSpec: str
regPolicy: str
regDispatcher: str