summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2020-03-18 14:48:57 -0500
committerGitHub <noreply@github.com>2020-03-18 14:48:57 -0500
commit5134132ae9cc9c3fba1d5420353277cf3d96eb90 (patch)
treef2ac587bc046e66097038ada8917ec49ad09728a
parentcdbc935201f3c322a312e8ae8b78d044cbe27bf4 (diff)
parent6846925b31c752b97d7de0b2a76308e22b6264d5 (diff)
downloadnumpy-5134132ae9cc9c3fba1d5420353277cf3d96eb90.tar.gz
Merge pull request #15774 from eric-wieser/remove-f2py-global
MAINT: remove useless `global` statements
-rw-r--r--numpy/f2py/capi_maps.py2
-rw-r--r--numpy/f2py/cb_rules.py2
-rw-r--r--numpy/f2py/cfuncs.py4
-rw-r--r--numpy/f2py/f90mod_rules.py1
-rwxr-xr-xnumpy/f2py/rules.py1
-rw-r--r--numpy/lib/utils.py1
6 files changed, 2 insertions, 9 deletions
diff --git a/numpy/f2py/capi_maps.py b/numpy/f2py/capi_maps.py
index 26f77afe1..fabbfc4c2 100644
--- a/numpy/f2py/capi_maps.py
+++ b/numpy/f2py/capi_maps.py
@@ -318,7 +318,6 @@ def getstrlength(var):
def getarrdims(a, var, verbose=0):
- global depargs
ret = {}
if isstring(var) and not isarray(var):
ret['dims'] = getstrlength(var)
@@ -514,7 +513,6 @@ def sign2map(a, var):
varrfromat
intent
"""
- global lcb_map, cb_map
out_a = a
if isintent_out(var):
for k in var['intent']:
diff --git a/numpy/f2py/cb_rules.py b/numpy/f2py/cb_rules.py
index 54e49f68e..87887c152 100644
--- a/numpy/f2py/cb_rules.py
+++ b/numpy/f2py/cb_rules.py
@@ -436,7 +436,6 @@ cb_map = {}
def buildcallbacks(m):
- global cb_map
cb_map[m['name']] = []
for bi in m['body']:
if bi['block'] == 'interface':
@@ -448,7 +447,6 @@ def buildcallbacks(m):
def buildcallback(rout, um):
- global cb_map
from . import capi_maps
outmess('\tConstructing call-back function "cb_%s_in_%s"\n' %
diff --git a/numpy/f2py/cfuncs.py b/numpy/f2py/cfuncs.py
index 0d90e56d6..1d6ada247 100644
--- a/numpy/f2py/cfuncs.py
+++ b/numpy/f2py/cfuncs.py
@@ -1156,7 +1156,7 @@ def buildcfuncs():
############ Auxiliary functions for sorting needs ###################
def append_needs(need, flag=1):
- global outneeds, needs
+ # This function modifies the contents of the global `outneeds` dict.
if isinstance(need, list):
for n in need:
append_needs(n, flag)
@@ -1223,7 +1223,7 @@ def append_needs(need, flag=1):
def get_needs():
- global outneeds, needs
+ # This function modifies the contents of the global `outneeds` dict.
res = {}
for n in outneeds.keys():
out = []
diff --git a/numpy/f2py/f90mod_rules.py b/numpy/f2py/f90mod_rules.py
index e7d3ddf47..122fa8939 100644
--- a/numpy/f2py/f90mod_rules.py
+++ b/numpy/f2py/f90mod_rules.py
@@ -85,7 +85,6 @@ fgetdims2_sa = """\
def buildhooks(pymod):
- global fgetdims1, fgetdims2
from . import rules
ret = {'f90modhooks': [], 'initf90modhooks': [], 'body': [],
'need': ['F_FUNC', 'arrayobject.h'],
diff --git a/numpy/f2py/rules.py b/numpy/f2py/rules.py
index 6a4ad170a..6750bf705 100755
--- a/numpy/f2py/rules.py
+++ b/numpy/f2py/rules.py
@@ -1157,7 +1157,6 @@ def buildmodule(m, um):
"""
Return
"""
- global f2py_version, options
outmess('\tBuilding module "%s"...\n' % (m['name']))
ret = {}
mod_rules = defmod_rules[:]
diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py
index f81b4e6e4..f233c7240 100644
--- a/numpy/lib/utils.py
+++ b/numpy/lib/utils.py
@@ -832,7 +832,6 @@ def _lookfor_generate_cache(module, import_modules, regenerate):
or newly generated.
"""
- global _lookfor_caches
# Local import to speed up numpy's import time.
import inspect