Skip to content

Commit a0cc695

Browse files
authored
Enable some more ruff checks. NFC (#23477)
1 parent 678f3bc commit a0cc695

File tree

5 files changed

+6
-9
lines changed

5 files changed

+6
-9
lines changed

emsymbolizer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ def decodeVLQ(string):
131131
for c in string:
132132
try:
133133
integer = vlq_map[c]
134-
except ValueError:
135-
raise Error(f'Invalid character ({c}) in VLQ')
134+
except ValueError as e:
135+
raise Error(f'Invalid character ({c}) in VLQ') from e
136136
value += (integer & 31) << shift
137137
if integer & 32:
138138
shift += 5

pyproject.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,9 @@ lint.select = [
2727
]
2828

2929
lint.ignore = [
30-
"B006",
31-
"B011",
32-
"B018",
30+
"B011", # See https://github.com/PyCQA/flake8-bugbear/issues/66
3331
"B023",
3432
"B026",
35-
"B904",
3633
"E402",
3734
"E501",
3835
"E721",

test/test_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8381,7 +8381,7 @@ def test_maybe_wasm2js(self):
83818381
cmd = [PYTHON, path_from_root('tools/maybe_wasm2js.py'), 'test_hello_world.js', 'test_hello_world.wasm']
83828382
if self.is_optimizing():
83838383
cmd += ['-O2']
8384-
self.run_process(cmd, stdout=open('do_wasm2js.js', 'w')).stdout
8384+
self.run_process(cmd, stdout=open('do_wasm2js.js', 'w'))
83858385
# remove the wasm to make sure we never use it again
83868386
os.remove('test_hello_world.wasm')
83878387
# verify that it runs

test/test_other.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10467,7 +10467,7 @@ def test_split_dwarf_dwp(self):
1046710467
# Check that dwp runs, and results in usable output as well
1046810468
self.run_process([LLVM_DWP, '-e', 'a.out.wasm', '-o', 'a.out.wasm.dwp'])
1046910469
self.assertExists('a.out.wasm.dwp')
10470-
self.run_process([LLVM_DWARFDUMP, 'a.out.wasm.dwp'], stdout=PIPE).stdout
10470+
self.run_process([LLVM_DWARFDUMP, 'a.out.wasm.dwp'], stdout=PIPE)
1047110471
self.assertIn('.debug_info.dwo contents:', dwdump)
1047210472
self.assertIn('DW_AT_GNU_dwo_name\t("hello_world.dwo")', dwdump)
1047310473
self.assertIn('DW_AT_name\t("main")', dwdump)

tools/shared.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def exec_process(cmd):
252252
os.execvp(cmd[0], cmd)
253253

254254

255-
def run_js_tool(filename, jsargs=[], node_args=[], **kw): # noqa: mutable default args
255+
def run_js_tool(filename, jsargs=[], node_args=[], **kw): # noqa: B006
256256
"""Execute a javascript tool.
257257
258258
This is used by emcc to run parts of the build process that are written

0 commit comments

Comments
 (0)