diff --git a/PyStand.cpp b/PyStand.cpp index 9cd4bd9..6400f8f 100644 --- a/PyStand.cpp +++ b/PyStand.cpp @@ -345,10 +345,13 @@ const char *init_script = " sys.stderr = fp\n" " attached = True\n" "except Exception as e:\n" -" fp = open(os.devnull, 'w', errors='ignore')\n" -" sys.stdout = fp\n" -" sys.stderr = fp\n" -" attached = False\n" +" try:\n" +" fp = open(os.devnull, 'w', errors='ignore')\n" +" sys.stdout = fp\n" +" sys.stderr = fp\n" +" attached = False\n" +" except:\n" +" pass\n" #endif "for n in ['.', 'lib', 'site-packages', 'runtime']:\n" " test = os.path.abspath(os.path.join(PYSTAND_HOME, n))\n"