systematic use of context managers for dealing with files instead of open()/close...
[nepi.git] / test / resources / linux / ns3 / cross_dce_linux_ccn.py
index 7dbee17..109d44d 100755 (executable)
@@ -243,9 +243,8 @@ class LinuxNS3FdNetDeviceTest(unittest.TestCase):
         time.sleep(60)
 
         stdout = ec.trace(ccncat, "stdout")
-        f = open("bunny.ts", "w")
-        f.write(stdout)
-        f.close()
+        with open("bunny.ts", "w") as f:
+            f.write(stdout)
 
         #expected = "DATA"
         #self.assertTrue(stdout.find(expected) > -1)