Use an import style reported not broken on Python 3.6

Couldn't reproduce the issue but it has been documented in #550.
This commit is contained in:
Daniele Varrazzo 2017-06-15 10:11:48 +01:00
parent 8ab16807c6
commit 991f0988ee
4 changed files with 6 additions and 4 deletions

2
NEWS
View File

@ -20,6 +20,8 @@ What's new in psycopg 2.7.2
(:ticket:`#545`).
- Fixed `~psycopg2.extras.ReplicationCursor.consume_stream()`
*keepalive_interval* argument (:ticket:`#547`).
- Maybe fixed random import error on Python 3.6 in multiprocess
environment (:ticket:`#550`).
- Fixed random `!SystemError` upon receiving abort signal (:ticket:`#551`).
- Parse intervals returned as microseconds from Redshift (:ticket:`#558`).
- Added `~psycopg2.extras.Json` `!prepare()` method to consider connection

View File

@ -65,7 +65,7 @@ from psycopg2 import tz # noqa
# Register default adapters.
import psycopg2.extensions as _ext
from psycopg2 import extensions as _ext
_ext.register_adapter(tuple, _ext.SQL_IN)
_ext.register_adapter(type(None), _ext.NoneAdapter)

View File

@ -25,7 +25,7 @@ This module implements thread-safe (and not) connection pools.
# License for more details.
import psycopg2
import psycopg2.extensions as _ext
from psycopg2 import extensions as _ext
class PoolError(psycopg2.Error):

View File

@ -28,12 +28,12 @@ old code while porting to psycopg 2. Import it as follows::
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
# License for more details.
import psycopg2._psycopg as _2psycopg # noqa
from psycopg2 import _psycopg as _2psycopg # noqa
from psycopg2.extensions import cursor as _2cursor
from psycopg2.extensions import connection as _2connection
from psycopg2 import * # noqa
import psycopg2.extensions as _ext
from psycopg2 import extensions as _ext
_2connect = connect