Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2022-01-05 06:50:14 +0300
committerGitHub <noreply@github.com>2022-01-05 06:50:14 +0300
commitbd9272628f028f4f7c987156406be4c187bae02f (patch)
tree9cce94fbb21548d1f6671a4937a2747fcdb84879 /configure.py
parent513e9fd0b61166268a8c73002899fd713aba9e6c (diff)
build: use list for mutable retval rather than tuple
We define `retval` as a tuple and then replace the tuple by "appending" items with `+=` but that actually creates a new tuple every time. Because it is intended to be mutable, use a list instead, then return a tuple from the function, as it should be immutable outside the function. PR-URL: https://github.com/nodejs/node/pull/41372 Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'configure.py')
-rwxr-xr-xconfigure.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/configure.py b/configure.py
index 0156afdc4c9..a1b5c5570b6 100755
--- a/configure.py
+++ b/configure.py
@@ -828,7 +828,7 @@ def pkg_config(pkg):
otherwise (None, None, None, None)"""
pkg_config = os.environ.get('PKG_CONFIG', 'pkg-config')
args = [] # Print pkg-config warnings on first round.
- retval = ()
+ retval = []
for flag in ['--libs-only-l', '--cflags-only-I',
'--libs-only-L', '--modversion']:
args += [flag]
@@ -843,9 +843,9 @@ def pkg_config(pkg):
except OSError as e:
if e.errno != errno.ENOENT: raise e # Unexpected error.
return (None, None, None, None) # No pkg-config/pkgconf installed.
- retval += (val,)
+ retval.append(val)
args = ['--silence-errors']
- return retval
+ return tuple(retval)
def try_check_compiler(cc, lang):