Skip to content

[3.13] tests: use errno.EBADF instead of hardcoded number in _close_file() (GH-148345)#148411

Open
miss-islington wants to merge 1 commit intopython:3.13from
miss-islington:backport-cef334f-3.13
Open

[3.13] tests: use errno.EBADF instead of hardcoded number in _close_file() (GH-148345)#148411
miss-islington wants to merge 1 commit intopython:3.13from
miss-islington:backport-cef334f-3.13

Conversation

@miss-islington
Copy link
Copy Markdown
Contributor

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 cef334f)

Co-authored-by: Artem Yarulin artem.yarulin@kapteko.com

…ythonGH-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>
@python-cla-bot
Copy link
Copy Markdown

python-cla-bot bot commented Apr 12, 2026

All commit authors signed the Contributor License Agreement.

CLA signed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants