Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,13 @@ def main(args):
continue
print(f'Out-of-date: {name}')
if args.dry_run:
if type(action) == list:
if isinstance(action, list):
action_str = ' '.join(action)
else:
action_str = action.__name__
print(f' (skipping: dry run) -> {action_str}')
continue
if type(action) == list:
if isinstance(action, list):
run_cmd(action)
else:
action()
Expand Down
4 changes: 2 additions & 2 deletions embuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ def get_port_variant(name):


def clear_port(port_name):
with get_port_variant(port_name) as port_name:
ports.clear_port(port_name, settings)
with get_port_variant(port_name) as port_name_base:
ports.clear_port(port_name_base, settings)


def build_port(port_name):
Expand Down
1 change: 0 additions & 1 deletion emrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,6 @@ def handle_incoming_message(self, seq_num, log, data):
# queued message, ignoring the proper order. This ensures that if any
# messages are actually lost, that the message queue will be orderly flushed.
def print_timed_out_messages(self):
global last_message_time
with http_mutex:
now = tick()
max_message_queue_time = 5
Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ lint.ignore = [
"module-import-not-at-top-of-file",
"multiple-leading-hashes-for-block-comment",
"line-too-long",
"type-comparison",
"ambiguous-variable-name",
"indentation-with-invalid-multiple", # Does not honor `indent-width`. See https://github.com/astral-sh/ruff/issues/8705
"indentation-with-invalid-multiple-comment", # Does not honor `indent-width`. See https://github.com/astral-sh/ruff/issues/8705
Expand All @@ -67,9 +66,7 @@ lint.ignore = [
"too-many-boolean-expressions",
"too-many-locals",
"too-many-nested-blocks",
"redefined-argument-from-local",
"no-self-use",
"global-variable-not-assigned",
"global-statement",
"too-many-statements-in-try-clause",
"subprocess-run-without-check",
Expand Down
1 change: 0 additions & 1 deletion test/jsrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def check_engine(engine):
engine_path = engine[0]
else:
engine_path = engine
global WORKING_ENGINES
if engine_path not in WORKING_ENGINES:
logging.debug(f'Checking JS engine {engine}')
try:
Expand Down
2 changes: 1 addition & 1 deletion test/test_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def is_jspi(args):


def skipIfFeatureNotAvailable(skip_env_var, feature, message):
for env_var in skip_env_var if type(skip_env_var) == list else [skip_env_var]:
for env_var in skip_env_var if isinstance(skip_env_var, list) else [skip_env_var]:
should_skip = browser_should_skip_feature(env_var, feature)
if should_skip:
break
Expand Down
4 changes: 2 additions & 2 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -15067,8 +15067,8 @@ def test_unused_destructor(self):
self.assertNotIn(b'hello from dtor', read_binary('test_unused_destructor.wasm'))

def test_strip_all(self):
def has_debug_section(wasm):
with webassembly.Module('hello_world.wasm') as wasm:
def has_debug_section(wasm_file):
with webassembly.Module(wasm_file) as wasm:
return wasm.get_custom_section('.debug_info') is not None

# Use -O2 to ensure wasm-opt gets run
Expand Down
6 changes: 3 additions & 3 deletions tools/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ def parse_string_list(text):
return []
return parse_string_list_members(text)

if expected_type == list or (text and text[0] == '['):
if expected_type is list or (text and text[0] == '['):
# if json parsing fails, we fall back to our own parser, which can handle a few
# simpler syntaxes
try:
Expand All @@ -703,7 +703,7 @@ def parse_string_list(text):

return parsed

if expected_type == float:
if expected_type is float:
try:
return float(text)
except ValueError:
Expand Down Expand Up @@ -749,7 +749,7 @@ def apply_user_settings():

expected_type = settings.types.get(key)

if filename and expected_type == list and value.strip()[0] != '[':
if filename and expected_type is list and value.strip()[0] != '[':
# Prefer simpler one-line-per value parser
value = parse_symbol_list_file(value)
else:
Expand Down
2 changes: 1 addition & 1 deletion tools/emscripten.py
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,7 @@ def create_receiving(function_exports, other_exports, library_symbols, aliases):
continue
receiving.append(f" assert(typeof wasmExports['{sym}'] != 'undefined', 'missing Wasm export: {sym}');")
for sym, info in exports.items():
is_function = type(info) == webassembly.FuncType
is_function = isinstance(info, webassembly.FuncType)
mangled = asmjs_mangle(sym)
assignment = mangled
if generate_dyncall_assignment and is_function and sym.startswith('dynCall_'):
Expand Down
2 changes: 1 addition & 1 deletion tools/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def check_type(self, name, value):
if not expected_type:
return
# Allow integers 1 and 0 for type `bool`
if expected_type == bool and type(value) is not list:
if expected_type is bool and type(value) is not list:
if value in {1, 0}:
value = bool(value)
if value in {'True', 'False', 'true', 'false'}:
Expand Down
Loading