]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] tests: use errno.EBADF instead of hardcoded number in _close_file() (GH-148345...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 13 Apr 2026 01:13:53 +0000 (03:13 +0200)
committerGitHub <noreply@github.com>
Mon, 13 Apr 2026 01:13:53 +0000 (18:13 -0700)
commit74be9e2c7624d117d4d77f6bf67546a05b64b25c
tree1b3bf5c4710e4a24f1d75b73da4f97f6e27744ae
parent9628a797da16a18e9dbacab40152bd827c053063
[3.13] tests: use errno.EBADF instead of hardcoded number in _close_file() (GH-148345) (#148411)

tests: use errno.EBADF instead of hardcoded number in _close_file() (GH-148345)

test_interpreters: use errno.EBADF instead of hardcoded number in _close_file()

Replace the hardcoded `9` check in `Lib/test/test_interpreters/utils.py` with `errno.EBADF`.

Using `errno.EBADF` makes the helper portable across platforms with different errno numbering while preserving the intended behavior.
(cherry picked from commit cef334fd4c4c24a542ce81ad940b1426b5a7cdbd)

Co-authored-by: Artem Yarulin <artem.yarulin@kapteko.com>
Lib/test/test_interpreters/utils.py