@@ -265,12 +265,10 @@ def autocommit(self, on):
265
265
266
266
def cursor (self , cursorclass = None ):
267
267
"""
268
-
269
268
Create a cursor on which queries may be performed. The
270
269
optional cursorclass parameter is used to create the
271
270
Cursor. By default, self.cursorclass=cursors.Cursor is
272
271
used.
273
-
274
272
"""
275
273
return (cursorclass or self .cursorclass )(self )
276
274
@@ -286,6 +284,9 @@ def query(self, query):
286
284
_mysql .connection .query (self , query )
287
285
288
286
def __enter__ (self ):
287
+ from warnings import warn
288
+ warn ("context interface will be changed. Use explicit conn.commit() or conn.rollback()." ,
289
+ DeprecationWarning , 2 )
289
290
if self .get_autocommit ():
290
291
self .query ("BEGIN" )
291
292
return self .cursor ()
@@ -319,7 +320,7 @@ def begin(self):
319
320
DEPRECATED: Will be removed in 1.3.
320
321
Use an SQL BEGIN statement instead."""
321
322
from warnings import warn
322
- warn ("begin() is non-standard and will be removed in 1.3 " ,
323
+ warn ("begin() is non-standard and will be removed in 1.4 " ,
323
324
DeprecationWarning , 2 )
324
325
self .query ("BEGIN" )
325
326
@@ -386,3 +387,5 @@ def show_warnings(self):
386
387
NotSupportedError = NotSupportedError
387
388
388
389
errorhandler = defaulterrorhandler
390
+
391
+ # vim: colorcolumn=100
0 commit comments