diff --git a/NEWS b/NEWS index 54094e90..93754eff 100644 --- a/NEWS +++ b/NEWS @@ -7,7 +7,8 @@ What's new in psycopg 2.8 Other changes: - Dropped support for Python 2.6, 3.2, 3.3. - +- Importing psycopg2.psycopg1 is now deprecated. Use psycopg2 instead. The + psycopg1 module will be removed in a future version. What's new in psycopg 2.7.4 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/lib/psycopg1.py b/lib/psycopg1.py index 0ee79422..d392cf0f 100644 --- a/lib/psycopg1.py +++ b/lib/psycopg1.py @@ -27,6 +27,7 @@ old code while porting to psycopg 2. Import it as follows:: # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public # License for more details. +import warnings from psycopg2 import _psycopg as _2psycopg # noqa from psycopg2.extensions import cursor as _2cursor @@ -36,6 +37,12 @@ from psycopg2 import * # noqa from psycopg2 import extensions as _ext _2connect = connect +warnings.warn( + 'Importing psycopg1 is deprecated. Use psycopg2 module instead. The ' + 'psycopg1 module will be removed in a future version.', + DeprecationWarning, +) + def connect(*args, **kwargs): """connect(dsn, ...) -> new psycopg 1.1.x compatible connection object"""