Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 80a3766

Browse filesBrowse files
Trotttargos
authored andcommitted
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: #41372 Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
1 parent 0768302 commit 80a3766
Copy full SHA for 80a3766

File tree

Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Open diff view settings
Collapse file

‎configure.py‎

Copy file name to clipboardExpand all lines: configure.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ def pkg_config(pkg):
828828
otherwise (None, None, None, None)"""
829829
pkg_config = os.environ.get('PKG_CONFIG', 'pkg-config')
830830
args = [] # Print pkg-config warnings on first round.
831-
retval = ()
831+
retval = []
832832
for flag in ['--libs-only-l', '--cflags-only-I',
833833
'--libs-only-L', '--modversion']:
834834
args += [flag]
@@ -843,9 +843,9 @@ def pkg_config(pkg):
843843
except OSError as e:
844844
if e.errno != errno.ENOENT: raise e # Unexpected error.
845845
return (None, None, None, None) # No pkg-config/pkgconf installed.
846-
retval += (val,)
846+
retval.append(val)
847847
args = ['--silence-errors']
848-
return retval
848+
return tuple(retval)
849849

850850

851851
def try_check_compiler(cc, lang):

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.