From f74cc39c33921c04a1cf909e49ab1777e43e44d3 Mon Sep 17 00:00:00 2001 From: VonEquinox Date: Fri, 24 Apr 2026 17:21:04 +0800 Subject: [PATCH] =?UTF-8?q?fix(cli):=20=E4=BF=AE=E5=A4=8D=E4=B8=AD?= =?UTF-8?q?=E6=96=87=E9=80=80=E6=A0=BC=E6=98=BE=E7=A4=BA=E6=AE=8B=E5=BD=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- agentmain.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/agentmain.py b/agentmain.py index 48f1757..16c1e35 100644 --- a/agentmain.py +++ b/agentmain.py @@ -1,5 +1,9 @@ import os, sys, threading, queue, time, json, re, random, locale os.environ.setdefault('GA_LANG', 'zh' if any(k in (locale.getlocale()[0] or '').lower() for k in ('zh', 'chinese')) else 'en') +try: + import readline +except Exception: + readline = None if sys.stdout is None: sys.stdout = open(os.devnull, "w") elif hasattr(sys.stdout, 'reconfigure'): sys.stdout.reconfigure(errors='replace') if sys.stderr is None: sys.stderr = open(os.devnull, "w")