Commit b7e27555 authored by Jeremy Hylton's avatar Jeremy Hylton

Remove Python 2.x-isms so that tests run under Python 1.5.2

parent 933086e3
...@@ -23,4 +23,4 @@ class IteratorStorage: ...@@ -23,4 +23,4 @@ class IteratorStorage:
assert rec.serial == revid assert rec.serial == revid
assert rec.version == '' assert rec.version == ''
assert zodb_unpickle(rec.data) == MinPO(val) assert zodb_unpickle(rec.data) == MinPO(val)
val += 1 val = val + 1
...@@ -53,8 +53,8 @@ def zodb_unpickle(data): ...@@ -53,8 +53,8 @@ def zodb_unpickle(data):
try: try:
klass = ns[klassname] klass = ns[klassname]
except KeyError: except KeyError:
print >> sys.stderr, "can't find %s in %s" % (klassname, sys.stderr.write("can't find %s in %s" % (klassname,
repr(ns)) repr(ns)))
inst = klass() inst = klass()
else: else:
raise ValueError, "expected class info: %s" % repr(klass_info) raise ValueError, "expected class info: %s" % repr(klass_info)
......
...@@ -59,15 +59,17 @@ TID = "\000" * 8 ...@@ -59,15 +59,17 @@ TID = "\000" * 8
class SynchronizedStorage: class SynchronizedStorage:
def verifyCommitting(self, callable, *args): ## def verifyCommitting(self, callable, *args):
self.assertRaises(StorageTransactionError, callable *args) ## self.assertRaises(StorageTransactionError, callable *args)
def verifyNotCommitting(self, callable, *args): def verifyNotCommitting(self, callable, *args):
self.assertRaises(StorageTransactionError, callable, *args) args = (StorageTransactionError, callable) + args
apply(self.assertRaises, args)
def verifyWrongTrans(self, callable, *args): def verifyWrongTrans(self, callable, *args):
self._storage.tpc_begin(self._transaction) self._storage.tpc_begin(self._transaction)
self.assertRaises(StorageTransactionError, callable, *args) args = (StorageTransactionError, callable) + args
apply(self.assertRaises, args)
def checkAbortVersionNotCommitting(self): def checkAbortVersionNotCommitting(self):
self.verifyNotCommitting(self._storage.abortVersion, self.verifyNotCommitting(self._storage.abortVersion,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment