Skip to content

Commit

Permalink
Remove context interface from Connector (#295)
Browse files Browse the repository at this point in the history
  • Loading branch information
methane authored Dec 4, 2018
1 parent 0d7fcc2 commit c64915b
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions MySQLdb/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,20 +253,6 @@ def query(self, query):
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
Expand Down

0 comments on commit c64915b

Please sign in to comment.