We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab954ac commit 3cb3bacCopy full SHA for 3cb3bac
playwright/_impl/_transport.py
@@ -34,10 +34,14 @@
34
35
# Sourced from: https://github.com/pytest-dev/pytest/blob/da01ee0a4bb0af780167ecd228ab3ad249511302/src/_pytest/faulthandler.py#L69-L77
36
def _get_stderr_fileno() -> Optional[int]:
37
- if sys.stderr.closed:
38
- return None
39
-
40
try:
+ # when using pythonw, sys.stderr is None.
+ # when Pyinstaller is used, there is no closed attribute because Pyinstaller monkey-patches it with a NullWriter class
+ if sys.stderr is None or not hasattr(sys.stderr, "closed"):
41
+ return None
42
+ if sys.stderr.closed:
43
44
+
45
return sys.stderr.fileno()
46
except (AttributeError, io.UnsupportedOperation):
47
# pytest-xdist monkeypatches sys.stderr with an object that is not an actual file.
0 commit comments