Skip to content

Commit e46b713

Browse files
authored
Replace usage of set([..]) with python set literals. NFC (#16090)
1 parent 9012104 commit e46b713

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

emcc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,16 +148,16 @@
148148
VALID_ENVIRONMENTS = ('web', 'webview', 'worker', 'node', 'shell')
149149
SIMD_INTEL_FEATURE_TOWER = ['-msse', '-msse2', '-msse3', '-mssse3', '-msse4.1', '-msse4.2', '-mavx']
150150
SIMD_NEON_FLAGS = ['-mfpu=neon']
151-
COMPILE_ONLY_FLAGS = set(['--default-obj-ext'])
152-
LINK_ONLY_FLAGS = set([
151+
COMPILE_ONLY_FLAGS = {'--default-obj-ext'}
152+
LINK_ONLY_FLAGS = {
153153
'--bind', '--closure', '--cpuprofiler', '--embed-file',
154154
'--emit-symbol-map', '--emrun', '--exclude-file', '--extern-post-js',
155155
'--extern-pre-js', '--ignore-dynamic-linking', '--js-library',
156156
'--js-transform', '--memory-init-file', '--oformat', '--output_eol',
157157
'--post-js', '--pre-js', '--preload-file', '--profiling-funcs',
158158
'--proxy-to-worker', '--shell-file', '--source-map-base',
159159
'--threadprofiler', '--use-preload-plugins'
160-
])
160+
}
161161

162162

163163
# this function uses the global 'final' variable, which contains the current

emscripten.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,16 @@ def optimize_syscalls(declares):
8080
settings.SYSCALLS_REQUIRE_FILESYSTEM = 0
8181
else:
8282
syscall_prefixes = ('__syscall_', 'fd_')
83-
syscalls = [d for d in declares if d.startswith(syscall_prefixes)]
83+
syscalls = {d for d in declares if d.startswith(syscall_prefixes)}
8484
# check if the only filesystem syscalls are in: close, ioctl, llseek, write
8585
# (without open, etc.. nothing substantial can be done, so we can disable
8686
# extra filesystem support in that case)
87-
if set(syscalls).issubset(set([
87+
if syscalls.issubset({
8888
'__syscall_ioctl',
8989
'fd_seek',
9090
'fd_write',
9191
'fd_close',
92-
])):
92+
}):
9393
if DEBUG:
9494
logger.debug('very limited syscalls (%s) so disabling full filesystem support', ', '.join(str(s) for s in syscalls))
9595
settings.SYSCALLS_REQUIRE_FILESYSTEM = 0

tools/building.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ def link_bitcode(args, target, force_archive_contents=False):
405405
# Tracking unresolveds is necessary for .a linking, see below.
406406
# Specify all possible entry points to seed the linking process.
407407
# For a simple application, this would just be "main".
408-
unresolved_symbols = set([func[1:] for func in settings.EXPORTED_FUNCTIONS])
408+
unresolved_symbols = {func[1:] for func in settings.EXPORTED_FUNCTIONS}
409409
resolved_symbols = set()
410410
# Paths of already included object files from archives.
411411
added_contents = set()
@@ -1028,7 +1028,7 @@ def metadce(js_file, wasm_file, minify_whitespace, debug_info):
10281028
'root': True
10291029
})
10301030
# fix wasi imports TODO: support wasm stable with an option?
1031-
WASI_IMPORTS = set([
1031+
WASI_IMPORTS = {
10321032
'environ_get',
10331033
'environ_sizes_get',
10341034
'args_get',
@@ -1044,7 +1044,7 @@ def metadce(js_file, wasm_file, minify_whitespace, debug_info):
10441044
'proc_exit',
10451045
'clock_res_get',
10461046
'clock_time_get',
1047-
])
1047+
}
10481048
for item in graph:
10491049
if 'import' in item and item['import'][1][1:] in WASI_IMPORTS:
10501050
item['import'][0] = settings.WASI_MODULE_NAME

tools/maint/check_for_unused_test_files.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,24 @@
1212
script_dir = os.path.dirname(os.path.abspath(__file__))
1313
root_dir = os.path.dirname(os.path.dirname(script_dir))
1414
test_dir = os.path.join(root_dir, 'tests')
15-
ignore_dirs = set([
15+
ignore_dirs = {
1616
'third_party',
1717
'metadce',
1818
'__pycache__',
19-
])
20-
ignore_files = set([
19+
}
20+
ignore_files = {
2121
'getValue_setValue_assert.out',
2222
'legacy_exported_runtime_numbers_assert.out',
23-
])
23+
}
2424
ignore_root_patterns = ['runner.*', 'test_*.py']
25-
ignore_root_files = set([
25+
ignore_root_files = {
2626
'jsrun.py',
2727
'clang_native.py',
2828
'common.py',
2929
'parallel_testsuite.py',
3030
'parse_benchmark_output.py',
3131
'malloc_bench.c',
32-
])
32+
}
3333

3434

3535
def grep(string, subdir=''):

tools/ports/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def get_needed_ports(settings):
313313

314314
def build_port(port_name, settings):
315315
port = ports_by_name[port_name]
316-
port_set = set((port,))
316+
port_set = {port}
317317
resolve_dependencies(port_set, settings)
318318
for port in dependency_order(port_set):
319319
port.get(Ports, settings, shared)

0 commit comments

Comments
 (0)