@@ -166,7 +166,7 @@ def will_metadce():
166166def setup_environment_settings ():
167167 # Environment setting based on user input
168168 environments = settings .ENVIRONMENT .split (',' )
169- if any ([ x for x in environments if x not in VALID_ENVIRONMENTS ] ):
169+ if any (x for x in environments if x not in VALID_ENVIRONMENTS ):
170170 exit_with_error (f'Invalid environment specified in "ENVIRONMENT": { settings .ENVIRONMENT } . Should be one of: { "," .join (VALID_ENVIRONMENTS )} ' )
171171
172172 settings .ENVIRONMENT_MAY_BE_WEB = not settings .ENVIRONMENT or 'web' in environments
@@ -216,8 +216,7 @@ def get_js_sym_info():
216216 # and can contain full paths to temporary files.
217217 skip_settings = {'PRE_JS_FILES' , 'POST_JS_FILES' }
218218 input_files = [json .dumps (settings .external_dict (skip_keys = skip_settings ), sort_keys = True , indent = 2 )]
219- for jslib in sorted (glob .glob (utils .path_from_root ('src' ) + '/library*.js' )):
220- input_files .append (read_file (jslib ))
219+ input_files .extend (read_file (jslib ) for jslib in sorted (glob .glob (utils .path_from_root ('src' ) + '/library*.js' )))
221220 for jslib in settings .JS_LIBRARIES :
222221 if not os .path .isabs (jslib ):
223222 jslib = utils .path_from_root ('src' , jslib )
@@ -626,7 +625,7 @@ def check_browser_versions():
626625
627626 if settings .LEGACY_VM_SUPPORT :
628627 # Default all browser versions to zero
629- for key in min_version_settings . keys () :
628+ for key in min_version_settings :
630629 default_setting (key , 0 )
631630
632631 for key , oldest in min_version_settings .items ():
@@ -967,9 +966,8 @@ def phase_linker_setup(options, state, newargs):
967966 if settings .MINIMAL_RUNTIME_STREAMING_WASM_COMPILATION and settings .MINIMAL_RUNTIME_STREAMING_WASM_INSTANTIATION :
968967 exit_with_error ('MINIMAL_RUNTIME_STREAMING_WASM_COMPILATION and MINIMAL_RUNTIME_STREAMING_WASM_INSTANTIATION are mutually exclusive!' )
969968
970- if options .emrun :
971- if settings .MINIMAL_RUNTIME :
972- exit_with_error ('--emrun is not compatible with MINIMAL_RUNTIME' )
969+ if options .emrun and settings .MINIMAL_RUNTIME :
970+ exit_with_error ('--emrun is not compatible with MINIMAL_RUNTIME' )
973971
974972 if options .use_closure_compiler :
975973 settings .USE_CLOSURE_COMPILER = 1
@@ -2943,7 +2941,7 @@ def process_dynamic_libs(dylibs, lib_dirs):
29432941 dylibs += extras
29442942 for dylib in dylibs :
29452943 exports = webassembly .get_exports (dylib )
2946- exports = set ( e .name for e in exports )
2944+ exports = { e .name for e in exports }
29472945 # EM_JS function are exports with a special prefix. We need to strip
29482946 # this prefix to get the actual symbol name. For the main module, this
29492947 # is handled by extract_metadata.py.
@@ -2957,7 +2955,7 @@ def process_dynamic_libs(dylibs, lib_dirs):
29572955 # TODO(sbc): Integrate with metadata.invoke_funcs that comes from the
29582956 # main module to avoid creating new invoke functions at runtime.
29592957 imports = set (imports )
2960- imports = set ( i for i in imports if not i .startswith ('invoke_' ))
2958+ imports = { i for i in imports if not i .startswith ('invoke_' )}
29612959 weak_imports = webassembly .get_weak_imports (dylib )
29622960 strong_imports = sorted (imports .difference (weak_imports ))
29632961 logger .debug ('Adding symbols requirements from `%s`: %s' , dylib , imports )
0 commit comments