py313: Also ignore cheroot error on Windows

See #8205
This commit is contained in:
Florian Bruhin 2024-12-09 22:49:29 +01:00
parent 68eacd2036
commit 45d04be1c9
1 changed files with 7 additions and 1 deletions

View File

@ -343,7 +343,13 @@ def unraisable_hook(unraisable: "sys.UnraisableHookArgs") -> None:
if (
sys.version_info[:2] == (3, 13)
and isinstance(unraisable.exc_value, OSError)
and unraisable.exc_value.errno == errno.EBADF
and (
unraisable.exc_value.errno == errno.EBADF
or (
sys.platform == "win32"
and unraisable.exc_value.winerror == errno.WSAENOTSOCK
)
)
and unraisable.object.__qualname__ == "IOBase.__del__"
):
# WORKAROUND for bogus exceptions with cheroot: