Index: transaction/_transaction.py =================================================================== --- transaction/_transaction.py (revision 103877) +++ transaction/_transaction.py (working copy) @@ -105,7 +105,7 @@ import traceback from cStringIO import StringIO -from zope import interface +from zope.interface import implements from transaction.weakset import WeakSet from transaction.interfaces import TransactionFailedError @@ -133,8 +133,8 @@ class Transaction(object): - interface.implements(interfaces.ITransaction, - interfaces.ITransactionDeprecated) + implements(interfaces.ITransaction, + interfaces.ITransactionDeprecated) # Assign an index to each savepoint so we can invalidate later savepoints @@ -408,7 +408,10 @@ # Execute the two-phase commit protocol. L = list(self._resources) - L.sort(rm_cmp) + if sys.version_info < (3,): + L.sort(rm_cmp) + else: + L.sort(key=lambda o:o.sortKey()) try: for rm in L: rm.tpc_begin(self) @@ -628,7 +631,7 @@ Transaction savepoints coordinate savepoints for data managers participating in a transaction. """ - interface.implements(interfaces.ISavepoint) + implements(interfaces.ISavepoint) valid = property(lambda self: self.transaction is not None) Index: ez_setup.py =================================================================== --- ez_setup.py (revision 103877) +++ ez_setup.py (working copy) @@ -94,7 +94,7 @@ try: pkg_resources.require("setuptools>="+version) - except pkg_resources.VersionConflict, e: + except pkg_resources.VersionConflict: # XXX could we install in a subprocess here? print >>sys.stderr, ( "The required version of setuptools (>=%s) is not available, and\n" @@ -186,8 +186,8 @@ from setuptools.command.easy_install import main main(argv) else: - print "Setuptools version",version,"or greater has been installed." - print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)' + print("Setuptools version",version,"or greater has been installed.") + print('(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)') Index: setup.py =================================================================== --- setup.py (revision 103877) +++ setup.py (working copy) @@ -21,11 +21,20 @@ from setuptools import setup, find_packages +import setuptools +setuptools.run_2to3=True + here = os.path.abspath(os.path.dirname(__file__)) README = (open(os.path.join(here, 'README.txt')).read() + '\n\n' + open(os.path.join(here, 'CHANGES.txt')).read()) +try: + from setuptools import lib2to3_fixer_packages + lib2to3_fixer_packages.append('zope.fixers') +except ImportError: + pass + setup(name='transaction', version=__version__, description='Transaction management for Python', @@ -56,6 +65,6 @@ 'zope.interface', ], entry_points = """\ - """ + """, )