mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-16 03:50:43 +08:00
Use setuptools instead of distutils. Add Python-2.5 support for with statement as described in http://docs.python.org/whatsnew/pep-343.html *Please test*
This commit is contained in:
@ -225,6 +225,14 @@ class Connection(_mysql.connection):
|
|||||||
"""
|
"""
|
||||||
return (cursorclass or self.cursorclass)(self)
|
return (cursorclass or self.cursorclass)(self)
|
||||||
|
|
||||||
|
def __enter__(self): return self.cursor()
|
||||||
|
|
||||||
|
def __exit__(self, exc, value, tb):
|
||||||
|
if exc:
|
||||||
|
self.rollback()
|
||||||
|
else:
|
||||||
|
self.commit()
|
||||||
|
|
||||||
def literal(self, o):
|
def literal(self, o):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
from distutils.core import setup
|
import ez_setup; ez_setup.use_setuptools()
|
||||||
from distutils.extension import Extension
|
from setuptools import setup, Extension
|
||||||
|
|
||||||
if sys.version_info < (2, 3):
|
if sys.version_info < (2, 3):
|
||||||
raise Error, "Python-2.3 or newer is required"
|
raise Error, "Python-2.3 or newer is required"
|
||||||
|
Reference in New Issue
Block a user