Author: elias
Date: Mon Apr 28 16:53:26 2008
New Revision: 26203

URL: http://svn.gna.org/viewcvs/wesnoth?rev=26203&view=rev
Log:
Python's stderr is redirected to a file pyerr.txt - made the python script 
execute even if pyerr.txt cannot be written to.

Modified:
    trunk/src/ai_python.cpp

Modified: trunk/src/ai_python.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ai_python.cpp?rev=26203&r1=26202&r2=26203&view=diff
==============================================================================
--- trunk/src/ai_python.cpp (original)
+++ trunk/src/ai_python.cpp Mon Apr 28 16:53:26 2008
@@ -1967,7 +1967,10 @@
                "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"


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to