]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Python 3: use "open" instead of "file"
authorCyril Roelandt <cyril@redhat.com>
Mon, 28 Sep 2015 11:46:35 +0000 (13:46 +0200)
committerCyril Roelandt <cyril@redhat.com>
Mon, 28 Sep 2015 11:46:35 +0000 (13:46 +0200)
The "file" function does not exist in Python 3.

Change-Id: I18561fc8e472a53c2c5f599f2312347da4cec273
Partial-Bug: #1500400

neutron/tests/functional/agent/linux/test_async_process.py

index a1bb40d919db70faa8ee609cc39cc581b3ab891a..46bc93b965df212b88e56a445611305dd5cbc2ed 100644 (file)
@@ -25,7 +25,7 @@ class AsyncProcessTestFramework(base.BaseTestCase):
         super(AsyncProcessTestFramework, self).setUp()
         self.test_file_path = self.get_temp_file_path('test_async_process.tmp')
         self.data = [str(x) for x in range(4)]
-        with file(self.test_file_path, 'w') as f:
+        with open(self.test_file_path, 'w') as f:
             f.writelines('%s\n' % item for item in self.data)
 
     def _check_stdout(self, proc):