Work around a 2to3 next fixer bug in a test

This commit is contained in:
Daniele Varrazzo 2011-02-11 17:54:41 +00:00
parent 1a0c494417
commit 9e9c221637

View File

@ -136,9 +136,9 @@ class CursorTests(unittest.TestCase):
# timestamp will not be influenced by the pause in Python world. # timestamp will not be influenced by the pause in Python world.
curs.execute("""select clock_timestamp() from generate_series(1,2)""") curs.execute("""select clock_timestamp() from generate_series(1,2)""")
i = iter(curs) i = iter(curs)
t1 = i.next()[0] t1 = (i.next())[0] # the brackets work around a 2to3 bug
time.sleep(0.2) time.sleep(0.2)
t2 = i.next()[0] t2 = (i.next())[0]
self.assert_((t2 - t1).microseconds * 1e-6 < 0.1, self.assert_((t2 - t1).microseconds * 1e-6 < 0.1,
"named cursor records fetched in 2 roundtrips (delta: %s)" "named cursor records fetched in 2 roundtrips (delta: %s)"
% (t2 - t1)) % (t2 - t1))