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.
from collections import namedtuple
import contextlib
+import errno
import json
import logging
import os
else:
os.close(file)
except OSError as exc:
- if exc.errno != 9:
+ if exc.errno != errno.EBADF:
raise # re-raise
# It was closed already.