Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit44659d3

Browse files
hroncokEclips4
andauthored
pythonGH-118943: Handle races when moving jit_stencils.h (pythonGH-120690)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
1 parent5bd7291 commit44659d3

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fix a possible race condition affecting parallel builds configured with
2+
``--enable-experimental-jit``, in which:exc:`FileNotFoundError` could be caused by
3+
another process already moving ``jit_stencils.h.new`` to ``jit_stencils.h``.

‎Tools/jit/_targets.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,12 @@ def build(
221221
file.write("\n")
222222
forlinein_writer.dump(stencil_groups):
223223
file.write(f"{line}\n")
224-
jit_stencils_new.replace(jit_stencils)
224+
try:
225+
jit_stencils_new.replace(jit_stencils)
226+
exceptFileNotFoundError:
227+
# another process probably already moved the file
228+
ifnotjit_stencils.is_file():
229+
raise
225230
finally:
226231
jit_stencils_new.unlink(missing_ok=True)
227232

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp