Skip to content

Commit ce9db80

Browse files
authored
fix(stderr): remove the stderr patching hacks (microsoft#318)
1 parent 8c6d4e4 commit ce9db80

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

playwright/main.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# limitations under the License.
1414

1515
import asyncio
16-
import io
1716
import os
1817
import subprocess
1918
import sys
@@ -43,22 +42,12 @@ def compute_driver_executable() -> Path:
4342
async def run_driver_async() -> Connection:
4443
driver_executable = compute_driver_executable()
4544

46-
# Sourced from: https://github.com/pytest-dev/pytest/blob/824e9cf67abcfc47df25a59bf32ebd8c25fbd02a/src/_pytest/faulthandler.py#L70-L77
47-
def _get_stderr_fileno() -> int:
48-
try:
49-
return sys.stderr.fileno()
50-
except (AttributeError, io.UnsupportedOperation):
51-
# pytest-xdist monkeypatches sys.stderr with an object that is not an actual file.
52-
# https://docs.python.org/3/library/faulthandler.html#issue-with-file-descriptors
53-
# This is potentially dangerous, but the best we can do.
54-
return sys.__stderr__.fileno()
55-
5645
proc = await asyncio.create_subprocess_exec(
5746
str(driver_executable),
5847
"run-driver",
5948
stdin=asyncio.subprocess.PIPE,
6049
stdout=asyncio.subprocess.PIPE,
61-
stderr=_get_stderr_fileno(),
50+
stderr=sys.stderr,
6251
limit=32768,
6352
)
6453
assert proc.stdout

0 commit comments

Comments
 (0)