Fix Cursor type

This commit is contained in:
Trinh Anh Ngoc
2022-05-09 16:47:44 +07:00
parent 60982a80d2
commit 12c0c4bbfa
2 changed files with 6 additions and 3 deletions

View File

@@ -1,9 +1,10 @@
from collections import Mapping, defaultdict as defaultdict from collections import Mapping, defaultdict as defaultdict
from odoo.sql_db import Cursor
from odoo.tools import table_exists as table_exists from odoo.tools import table_exists as table_exists
from typing import Any, Optional from typing import Any, Optional
from ..sql_db import Cursor
_logger: Any _logger: Any
class Registry(Mapping): class Registry(Mapping):

View File

@@ -1,5 +1,7 @@
import psycopg2.extensions import psycopg2.extensions
from typing import Any, Optional from typing import Any, Optional, TypeVar
_T = TypeVar('_T')
_logger: Any _logger: Any
@@ -45,7 +47,7 @@ class Cursor:
def _pop_event_handlers(self): ... def _pop_event_handlers(self): ...
def commit(self): ... def commit(self): ...
def rollback(self): ... def rollback(self): ...
def __enter__(self): ... def __enter__(self: _T) -> _T: ...
def __exit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> None: ... def __exit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> None: ...
def savepoint(self) -> None: ... def savepoint(self) -> None: ...
def __getattr__(self, name: Any): ... def __getattr__(self, name: Any): ...