From c64915b1e5c705f4fb10e86db5dcfed0b58552cc Mon Sep 17 00:00:00 2001 From: INADA Naoki Date: Tue, 4 Dec 2018 20:53:53 +0900 Subject: [PATCH] Remove context interface from Connector (#295) --- MySQLdb/connections.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/MySQLdb/connections.py b/MySQLdb/connections.py index 1629073..574f72e 100644 --- a/MySQLdb/connections.py +++ b/MySQLdb/connections.py @@ -253,20 +253,6 @@ class Connection(_mysql.connection): else: _mysql.connection.query(self, query) - def __enter__(self): - from warnings import warn - warn("context interface will be changed. Use explicit conn.commit() or conn.rollback().", - DeprecationWarning, 2) - if self.get_autocommit(): - self.query("BEGIN") - return self.cursor() - - def __exit__(self, exc, value, tb): - if exc: - self.rollback() - else: - self.commit() - def _bytes_literal(self, bs): assert isinstance(bs, (bytes, bytearray)) x = self.string_literal(bs) # x is escaped and quoted bytes