- Added the LOAD command to TextSimulation, and the classic question made to user on replacing an unsaved simulation

- Changed the way syntactically incorrect python policies are handled, we no more exit abruptly

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@829 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
elvez 2006-08-08 00:20:56 +00:00
parent d72ce96508
commit 0138387a7f
8 changed files with 189 additions and 14 deletions

View file

@ -32,7 +32,7 @@ using namespace std;
// WARNING : this class needs extensive and above all
// *strong* exception checking / handling!
PythonCPUPolicy::PythonCPUPolicy(const char* name)
PythonCPUPolicy::PythonCPUPolicy(const char* name) throw(MalformedPolicyException)
: _upolicy_dict(NULL), _adapter(NULL), _name(name)
{
PyObject* pLoadmeStr = PyString_FromString(name);
@ -42,8 +42,7 @@ PythonCPUPolicy::PythonCPUPolicy(const char* name)
if( !pUserCPUPolicyModule )
{
PyErr_Print(); // Error in import
// FIXME : don't exit abruptly, but fall back gracefully
exit(-1);
throw MalformedPolicyException("this message should be the stuff printed by PyErr_Print");
}
// Dictionary with defined ``symbols'' for .pyc file