Fix Cursor type

This commit is contained in:
Trinh Anh Ngoc
2022-05-09 16:33:53 +07:00
parent cf44e1693e
commit 0c5fec7e2a
2 changed files with 5 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
from collections.abc import Mapping from collections.abc import Mapping
from typing import Any from typing import Any
from odoo.sql_db import Cursor from ..sql_db import Cursor
_logger: Any _logger: Any
_schema: Any _schema: Any

View File

@@ -1,10 +1,12 @@
from typing import Any from typing import Any, TypeVar
import psycopg2.extensions import psycopg2.extensions
from .api import Transaction from .api import Transaction
from .tools import Callbacks from .tools import Callbacks
_T = TypeVar('_T')
_logger: Any _logger: Any
def unbuffer(symb, cr): ... def unbuffer(symb, cr): ...
@@ -30,7 +32,7 @@ class BaseCursor:
def clear(self) -> None: ... def clear(self) -> None: ...
def reset(self) -> None: ... def reset(self) -> None: ...
def savepoint(self, flush: bool = ...) -> None: ... def savepoint(self, flush: bool = ...) -> None: ...
def __enter__(self): ... def __enter__(self: _T) -> _T: ...
def __exit__(self, exc_type, exc_value, traceback) -> None: ... def __exit__(self, exc_type, exc_value, traceback) -> None: ...
class Cursor(BaseCursor): class Cursor(BaseCursor):