Skip to content

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

Open
artemyarulin wants to merge 1 commit intopython:mainfrom
artemyarulin:patch-1
Open

test_interpreters: use errno.EBADF instead of hardcoded number in _close_file()#148345
artemyarulin wants to merge 1 commit intopython:mainfrom
artemyarulin:patch-1

Conversation

@artemyarulin
Copy link
Copy Markdown

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.

Didn't create an issue for that as I think it could count as trivial

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

python-cla-bot bot commented Apr 10, 2026

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Apr 10, 2026

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

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.

1 participant