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")