Python's stderr is redirected to a file pyerr.txt...
...made the python script execute even if pyerr.txt cannot be written to.
This commit is contained in:
parent
1f5f895571
commit
cf449290cb
1 changed files with 4 additions and 1 deletions
|
@ -1967,7 +1967,10 @@ void python_ai::play_turn()
|
|||
"err = \"unknown error\"\n"
|
||||
"try:\n"
|
||||
"\timport sys, traceback\n"
|
||||
"\tsys.stderr = file(\"pyerr.txt\", \"wb\")\n"
|
||||
"\ttry:\n"
|
||||
"\t\tsys.stderr = file(\"pyerr.txt\", \"wb\")\n"
|
||||
"\texcept IOError:\n"
|
||||
"\t\tsys.stderr.write(\"Python: Could not create pyerr.txt in current directory.\\n\")\n"
|
||||
"\tbackup = sys.path[:]\n"
|
||||
"\tsys.path.append(\"" + path + "/data/ais\")\n"
|
||||
"\ttry:\n"
|
||||
|
|
Loading…
Add table
Reference in a new issue