Skip to content

Commit b3836dc

Browse files
authored
Fix ruff warning in emscripten (#25959)
Using `raise` on its own outside of a catch block does not work.
1 parent 20da9c6 commit b3836dc

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

emrun.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,12 +1351,12 @@ def subprocess_env():
13511351
def remove_tree(d):
13521352
os.chmod(d, stat.S_IWRITE)
13531353
try:
1354-
def remove_readonly_and_try_again(func, path, _exc_info):
1354+
def remove_readonly_and_try_again(func, path, exc_info):
13551355
if not (os.stat(path).st_mode & stat.S_IWRITE):
13561356
os.chmod(path, stat.S_IWRITE)
13571357
func(path)
13581358
else:
1359-
raise
1359+
raise exc_info[1]
13601360
shutil.rmtree(d, onerror=remove_readonly_and_try_again)
13611361
except Exception:
13621362
pass

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ lint.ignore = [
5555
"UP031", # TODO
5656
"UP032", # TODO
5757
]
58-
lint.per-file-ignores."emrun.py" = [ "PLE0704" ]
5958
lint.per-file-ignores."tools/ports/*.py" = [ "ARG001", "ARG005" ]
6059
lint.per-file-ignores."test/other/ports/*.py" = [ "ARG001" ]
6160
lint.per-file-ignores."test/parallel_testsuite.py" = [ "ARG002" ]

0 commit comments

Comments
 (0)