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)
|
||||
|
||||
def __enter__(self): return self.cursor()
|
||||
|
||||
def __exit__(self, exc, value, tb):
|
||||
if exc:
|
||||
self.rollback()
|
||||
else:
|
||||
self.commit()
|
||||
|
||||
def literal(self, o):
|
||||
"""
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
import os
|
||||
import sys
|
||||
from distutils.core import setup
|
||||
from distutils.extension import Extension
|
||||
import ez_setup; ez_setup.use_setuptools()
|
||||
from setuptools import setup, Extension
|
||||
|
||||
if sys.version_info < (2, 3):
|
||||
raise Error, "Python-2.3 or newer is required"
|
||||
|
Reference in New Issue
Block a user