From 962378bf800f859252c67da135f03e24586234f4 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Fri, 24 Sep 2021 13:44:54 +0200 Subject: 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. --- numpy/distutils/system_info.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'numpy/distutils/system_info.py') 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 -- cgit v1.2.1