diff options
author | Nick Papior Andersen <nickpapior@gmail.com> | 2015-02-25 10:00:27 +0000 |
---|---|---|
committer | Nick Papior Andersen <nickpapior@gmail.com> | 2015-02-25 10:00:27 +0000 |
commit | a2ec60c6b0ba610c635626d9fe10b569d6365a7f (patch) | |
tree | bf36017b6a2abedde374da5e92f96376be9224dc | |
parent | a6c2443a646eb46b0bca9d8560d52d5b9fa87c9d (diff) | |
download | numpy-a2ec60c6b0ba610c635626d9fe10b569d6365a7f.tar.gz |
BUG: Python3 fix
Direct writing to files is not the same for 2vs3.
Hence we now close the file handle, re-open it
and write using the file.
-rw-r--r-- | numpy/distutils/tests/test_system_info.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/numpy/distutils/tests/test_system_info.py b/numpy/distutils/tests/test_system_info.py index 1c37f1907..6564bbf5b 100644 --- a/numpy/distutils/tests/test_system_info.py +++ b/numpy/distutils/tests/test_system_info.py @@ -107,15 +107,16 @@ class TestSystemInfoReading(TestCase): }) # Write site.cfg fd, self._sitecfg = mkstemp() - os.write(fd,site_cfg) os.close(fd) + with open(self._sitecfg, 'w') as fd: + fd.write(site_cfg) # Write the sources - with open(self._src1,'w') as fd: + with open(self._src1, 'w') as fd: fd.write(fakelib_c_text) - with open(self._src2,'w') as fd: + with open(self._src2, 'w') as fd: fd.write(fakelib_c_text) # We create all class-instances - def site_and_parse(c,site_cfg): + def site_and_parse(c, site_cfg): c.files = [site_cfg] c.parse_config_files() return c |