summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2021-10-10 15:31:51 -0600
committerGitHub <noreply@github.com>2021-10-10 15:31:51 -0600
commit7dcb78fdf7fb3aa3ef68708d9dfdb6e332072a96 (patch)
treeaa5f64cf5516429627fa4bb4c9c76fc228df3f87 /numpy
parent325b72af0f781f3e3645a6086c0c85db101fdf7c (diff)
parent8add3c171446e65a22e4db961ca58273c492eb92 (diff)
downloadnumpy-7dcb78fdf7fb3aa3ef68708d9dfdb6e332072a96.tar.gz
Merge pull request #20057 from DimitriPapadopoulos/lgtm_warnings
MAINT: LGTM.com warnings
Diffstat (limited to 'numpy')
-rw-r--r--numpy/distutils/mingw32ccompiler.py7
-rwxr-xr-xnumpy/f2py/rules.py2
2 files changed, 4 insertions, 5 deletions
diff --git a/numpy/distutils/mingw32ccompiler.py b/numpy/distutils/mingw32ccompiler.py
index 4681d403b..541055899 100644
--- a/numpy/distutils/mingw32ccompiler.py
+++ b/numpy/distutils/mingw32ccompiler.py
@@ -651,7 +651,6 @@ def generate_manifest(config):
mi = int((msver - ma) * 10)
# Write the manifest file
manxml = msvc_manifest_xml(ma, mi)
- man = open(manifest_name(config), "w")
- config.temp_files.append(manifest_name(config))
- man.write(manxml)
- man.close()
+ with open(manifest_name(config), "w") as man:
+ config.temp_files.append(manifest_name(config))
+ man.write(manxml)
diff --git a/numpy/f2py/rules.py b/numpy/f2py/rules.py
index 24777df5b..78810a0a7 100755
--- a/numpy/f2py/rules.py
+++ b/numpy/f2py/rules.py
@@ -566,7 +566,7 @@ rout_rules = [
'callfortran':'#name#_return_value,#name#_return_value_len,',
'callfortranroutine':[' #name#_return_value_len = #rlength#;',
' if ((#name#_return_value = (string)malloc('
- '#name#_return_value_len+1) == NULL) {',
+ + '#name#_return_value_len+1) == NULL) {',
' PyErr_SetString(PyExc_MemoryError, \"out of memory\");',
' f2py_success = 0;',
' } else {',