Skip to content

Commit c20d661

Browse files
authored
fix: AttributeError with mocked stderr (fix microsoft#246) (microsoft#247)
1 parent 3b3fcdf commit c20d661

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

playwright/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ def compute_driver_executable() -> Path:
4343
async def run_driver_async() -> Connection:
4444
driver_executable = compute_driver_executable()
4545

46-
# Sourced from: https://github.com/pytest-dev/pytest/blob/49827adcb9256c9c9c06a25729421dcc3c385edc/src/_pytest/faulthandler.py#L73-L80
46+
# Sourced from: https://github.com/pytest-dev/pytest/blob/824e9cf67abcfc47df25a59bf32ebd8c25fbd02a/src/_pytest/faulthandler.py#L70-L77
4747
def _get_stderr_fileno() -> int:
4848
try:
4949
return sys.stderr.fileno()
50-
except io.UnsupportedOperation:
50+
except (AttributeError, io.UnsupportedOperation):
5151
# pytest-xdist monkeypatches sys.stderr with an object that is not an actual file.
5252
# https://docs.python.org/3/library/faulthandler.html#issue-with-file-descriptors
5353
# This is potentially dangerous, but the best we can do.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy