diff options
author | Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> | 2021-09-24 13:44:54 +0200 |
---|---|---|
committer | Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> | 2021-09-24 13:46:20 +0200 |
commit | 962378bf800f859252c67da135f03e24586234f4 (patch) | |
tree | f7e1c168d51f064c1b0be9bd78568497d79df543 /numpy/distutils/system_info.py | |
parent | 0cf5bc092f801a4c004ecdb7d1061f46aaab4ff4 (diff) | |
download | numpy-962378bf800f859252c67da135f03e24586234f4.tar.gz |
MAINT: Fix LGTM.com warning
Variable defined multiple times
This assignment to 'f' is unnecessary as it is redefined here before this value is used.
This originates in 6c8412f, where the intent was clearly to try an
alternative value for f in case NameError is raised:
f = sys.argv[0]
However, for this value to be actually used, the else: must be removed.
Diffstat (limited to 'numpy/distutils/system_info.py')
-rw-r--r-- | numpy/distutils/system_info.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py index c0404b0e8..7f41bb07e 100644 --- a/numpy/distutils/system_info.py +++ b/numpy/distutils/system_info.py @@ -387,11 +387,10 @@ def get_standard_file(fname): f = __file__ except NameError: f = sys.argv[0] - else: - sysfile = os.path.join(os.path.split(os.path.abspath(f))[0], - fname) - if os.path.isfile(sysfile): - filenames.append(sysfile) + sysfile = os.path.join(os.path.split(os.path.abspath(f))[0], + fname) + if os.path.isfile(sysfile): + filenames.append(sysfile) # Home directory # And look for the user config file |