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:
adustman
2007-02-25 00:16:43 +00:00
parent 692d79c30e
commit 48b09d439e
2 changed files with 10 additions and 2 deletions

View File

@ -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):
"""

View File

@ -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"