From 244f89d8cdf173ad666213f2c10c52556052b761 Mon Sep 17 00:00:00 2001 From: Eddie Antonio Santos Date: Tue, 18 Apr 2017 16:09:51 -0600 Subject: [PATCH] Add uri param for sqlite3.connect (Python 3.4+). (#1171) --- stdlib/3/sqlite3/dbapi2.pyi | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/stdlib/3/sqlite3/dbapi2.pyi b/stdlib/3/sqlite3/dbapi2.pyi index ef46085cb..f9858ab76 100644 --- a/stdlib/3/sqlite3/dbapi2.pyi +++ b/stdlib/3/sqlite3/dbapi2.pyi @@ -6,6 +6,8 @@ from numbers import Integral from datetime import time, datetime from collections import Iterable +import sys + paramstyle = ... # type: str threadsafety = ... # type: int apilevel = ... # type: str @@ -66,13 +68,10 @@ version = ... # type: str # TODO: adapt needs to get probed def adapt(obj, protocol, alternate): ... def complete_statement(sql: str) -> bool: ... -def connect(database: Union[bytes, AnyStr], - timeout: float = ..., - detect_types: int = ..., - isolation_level: Union[str, None] = ..., - check_same_thread: bool = ..., - factory: Union[Connection, None] = ..., - cached_statements: int = ...) -> Connection: ... +if sys.version_info >= (3, 4): + def connect(database: Union[bytes, AnyStr], timeout: float = ..., detect_types: int = ..., isolation_level: Union[str, None] = ..., check_same_thread: bool = ..., factory: Union[Connection, None] = ..., cached_statements: int = ..., uri: bool = ...) -> Connection: ... +else: + def connect(database: Union[bytes, AnyStr], timeout: float = ..., detect_types: int = ..., isolation_level: Union[str, None] = ..., check_same_thread: bool = ..., factory: Union[Connection, None] = ..., cached_statements: int = ...) -> Connection: ... def enable_callback_tracebacks(flag: bool) -> None: ... def enable_shared_cache(do_enable: int) -> None: ... def register_adapter(type: type, callable: Any) -> None: ...