BF(2.4): remove use of "with" for python 2.4 for now (since we list it as supported)

pull/522/head
Yaroslav Halchenko 2013-12-27 01:54:54 -05:00
parent 952de51cf1
commit c6a7bc2221
1 changed files with 8 additions and 2 deletions

View File

@ -540,13 +540,19 @@ class TransmitterLogging(TransmitterBase):
logSys.warn("After file moved")
self.assertEqual(self.transm.proceed(["flushlogs"]), (0, "rolled over"))
logSys.warn("After flushlogs")
with open(fn2,'r') as f:
# >py2.4: with open(fn2, 'r') as f:
f = open(fn2, 'r');
if True:
self.assertTrue(f.next().endswith("Before file moved\n"))
self.assertTrue(f.next().endswith("After file moved\n"))
self.assertRaises(StopIteration, f.next)
with open(fn,'r') as f:
f.close()
# >py2.4: with open(fn, 'r') as f:
f = open(fn, 'r');
if True:
self.assertTrue(f.next().endswith("After flushlogs\n"))
self.assertRaises(StopIteration, f.next)
f.close()
finally:
os.remove(fn2)
finally: