]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-42160: tempfile: Reduce overhead of pid check. (GH-22997)
authorEric W <robo-eric@gmx.de>
Fri, 30 Oct 2020 04:56:28 +0000 (05:56 +0100)
committerGitHub <noreply@github.com>
Fri, 30 Oct 2020 04:56:28 +0000 (13:56 +0900)
commit8e409cebad42032bb7d0f2cadd8b1e36081d98af
tree4347dffac5a388a69782692bfa63075bf8607cdf
parent9129af6050b747f288baa9d4e7d43031647ed222
bpo-42160: tempfile: Reduce overhead of pid check. (GH-22997)

The _RandomSequence class in tempfile used to check the current pid every time its rng property was used.
This commit replaces this code with `os.register_at_fork` to reduce the overhead.
Lib/tempfile.py
Lib/test/test_tempfile.py
Misc/NEWS.d/next/Library/2020-10-27-00-42-09.bpo-42160.eiLOCi.rst [new file with mode: 0644]