Skip to content

Commit e426ae2

Browse files
committed
[libcxx][dsl] Fix mutable default argument warning
This is flagged by PyCharm and can cause subtle bugs. While changing this also re-sort the imports and add missing ones. Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D88816
1 parent 4da4e7c commit e426ae2

File tree

1 file changed

+11
-4
lines changed
  • libcxx/utils/libcxx/test

1 file changed

+11
-4
lines changed

libcxx/utils/libcxx/test/dsl.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,20 @@
66
#
77
#===----------------------------------------------------------------------===##
88

9-
import libcxx.test.format
10-
import lit
11-
import lit.util
129
import os
1310
import pipes
1411
import platform
1512
import re
1613
import tempfile
1714

15+
import libcxx.test.format
16+
import lit
17+
import lit.LitConfig
18+
import lit.Test
19+
import lit.TestRunner
20+
import lit.util
21+
22+
1823
def _memoize(f):
1924
cache = dict()
2025
def memoized(x):
@@ -83,7 +88,7 @@ def sourceBuilds(config, source):
8388
_executeScriptInternal(test, ['rm %t.exe'])
8489
return exitCode == 0
8590

86-
def programOutput(config, program, args=[], testPrefix=''):
91+
def programOutput(config, program, args=None, testPrefix=''):
8792
"""
8893
Compiles a program for the test target, run it on the test target and return
8994
the output.
@@ -92,6 +97,8 @@ def programOutput(config, program, args=[], testPrefix=''):
9297
execution of the program is done through the %{exec} substitution, which means
9398
that the program may be run on a remote host depending on what %{exec} does.
9499
"""
100+
if args is None:
101+
args = []
95102
with _makeConfigTest(config, testPrefix=testPrefix) as test:
96103
with open(test.getSourcePath(), 'w') as source:
97104
source.write(program)

0 commit comments

Comments
 (0)