From 8838e31a6f4836c47416b1504a2cba1a48f6112d Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Thu, 10 Aug 2023 07:16:25 +0200 Subject: [PATCH] fix: allow sys.stderr.fileno() to throw NotImplementedError (#2040) --- playwright/_impl/_transport.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playwright/_impl/_transport.py b/playwright/_impl/_transport.py index 3c9f96be0..d49b5a2d5 100644 --- a/playwright/_impl/_transport.py +++ b/playwright/_impl/_transport.py @@ -37,7 +37,7 @@ def _get_stderr_fileno() -> Optional[int]: return None return sys.stderr.fileno() - except (AttributeError, io.UnsupportedOperation): + except (NotImplementedError, AttributeError, io.UnsupportedOperation): # pytest-xdist monkeypatches sys.stderr with an object that is not an actual file. # https://docs.python.org/3/library/faulthandler.html#issue-with-file-descriptors # This is potentially dangerous, but the best we can do.