Import AITURK IDE 1.0.0-beta.1 from Hermes 63279301; preserve MIT license

This commit is contained in:
2026-09-05 13:26:46 +03:00
commit 03634b1ca3
11340 changed files with 3442369 additions and 0 deletions
@@ -0,0 +1,34 @@
"""Regression: #71671 — gateway must survive faulthandler.enable() with sys.stderr=None."""
from __future__ import annotations
import faulthandler
import sys
import pytest
def test_faulthandler_enable_falls_back_when_stderr_is_none(tmp_path):
was_enabled = faulthandler.is_enabled()
if was_enabled:
faulthandler.disable()
real_stderr = sys.stderr
sys.stderr = None
try:
with pytest.raises(RuntimeError, match="sys.stderr is None"):
faulthandler.enable()
log_path = tmp_path / "gateway_faulthandler.log"
fh = open(log_path, "a", encoding="utf-8")
try:
faulthandler.enable(file=fh, all_threads=True)
assert faulthandler.is_enabled()
assert log_path.exists()
finally:
faulthandler.disable()
fh.close()
finally:
sys.stderr = real_stderr
if was_enabled:
faulthandler.enable()