mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
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>
This commit is contained in:
parent
513e9fd0b6
commit
bd9272628f
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user