diff options
author | Bharat123rox <bharatraghunthan9767@gmail.com> | 2019-05-08 10:46:32 +0530 |
---|---|---|
committer | Bharat123rox <bharatraghunthan9767@gmail.com> | 2019-05-08 10:46:32 +0530 |
commit | dcb2ecfb1ac05761a52671bc4179b120da7fe8e9 (patch) | |
tree | b74d080e79ab843d5c0d9ae8e592a177eca2cc9c | |
parent | 38025696d7f268b47d81e215bcf33c50ca1c98c1 (diff) | |
download | numpy-dcb2ecfb1ac05761a52671bc4179b120da7fe8e9.tar.gz |
Fixed possible regressions
-rw-r--r-- | numpy/distutils/conv_template.py | 2 | ||||
-rw-r--r-- | numpy/distutils/from_template.py | 2 | ||||
-rw-r--r-- | numpy/f2py/rules.py | 4 | ||||
-rw-r--r-- | numpy/ma/mrecords.py | 9 |
4 files changed, 11 insertions, 6 deletions
diff --git a/numpy/distutils/conv_template.py b/numpy/distutils/conv_template.py index 9f3b30957..157086f97 100644 --- a/numpy/distutils/conv_template.py +++ b/numpy/distutils/conv_template.py @@ -280,6 +280,8 @@ def resolve_includes(source): lines.extend(resolve_includes(fn)) else: lines.append(line) + else: + lines.append(line) return lines def process_file(source): diff --git a/numpy/distutils/from_template.py b/numpy/distutils/from_template.py index ed84df196..24b61fc02 100644 --- a/numpy/distutils/from_template.py +++ b/numpy/distutils/from_template.py @@ -225,6 +225,8 @@ def resolve_includes(source): lines.extend(resolve_includes(fn)) else: lines.append(line) + else: + lines.append(line) return lines def process_file(source): diff --git a/numpy/f2py/rules.py b/numpy/f2py/rules.py index 11f36cc32..6769f1b1f 100644 --- a/numpy/f2py/rules.py +++ b/numpy/f2py/rules.py @@ -1274,12 +1274,12 @@ def buildmodule(m, um): options['buildpath'], vrd['modulename'] + 'module.tex') ret['ltx'] = fn with open(fn, 'w') as f: - f.write( + f.write( '%% This file is auto-generated with f2py (version:%s)\n' % (f2py_version)) if 'shortlatex' not in options: f.write( '\\documentclass{article}\n\\usepackage{a4wide}\n\\begin{document}\n\\tableofcontents\n\n') - f.write('\n'.join(ar['latexdoc'])) + f.write('\n'.join(ar['latexdoc'])) if 'shortlatex' not in options: f.write('\\end{document}') outmess('\tDocumentation is saved to file "%s/%smodule.tex"\n' % diff --git a/numpy/ma/mrecords.py b/numpy/ma/mrecords.py index c7d7f5a36..9bcb3947d 100644 --- a/numpy/ma/mrecords.py +++ b/numpy/ma/mrecords.py @@ -659,12 +659,13 @@ def openfile(fname): return fname # Try to open the file and guess its type try: - with open(fname) as f: - if f.readline()[:2] != "\\x": - f.seek(0, 0) - return f + f = open(fname) except IOError: raise IOError("No such file: '%s'" % fname) + if f.readline()[:2] != "\\x": + f.seek(0, 0) + return f + f.close() raise NotImplementedError("Wow, binary file") |