From 3715476b92fec6a0fc1fd4111903e6e2ed31b1d9 Mon Sep 17 00:00:00 2001 From: adustman Date: Sun, 3 Apr 2005 05:17:34 +0000 Subject: [PATCH] Restore the begin() method, but issue a DeprecationWarning. --- MySQLdb/MySQLdb/connections.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/MySQLdb/MySQLdb/connections.py b/MySQLdb/MySQLdb/connections.py index 869f49a..d88318f 100644 --- a/MySQLdb/MySQLdb/connections.py +++ b/MySQLdb/MySQLdb/connections.py @@ -180,6 +180,15 @@ class Connection(_mysql.connection): """ return self.escape(o, self.converter) + def begin(self): + """Explicitly begin a connection. Non-standard. + DEPRECATED: Will be removed in 1.3. + Use an SQL BEGIN statement instead.""" + from warnings import warn + warn("begin() is non-standard and will be removed in 1.3", + DeprecationWarning) + self.query("BEGIN") + if not hasattr(_mysql.connection, 'warning_count'): def warning_count(self):