Bug in 2.2.2 ???

Mark VanTassel mark.vantassel at visionarysystemsinc.com
Fri Feb 7 14:53:36 CET 2003


The following code seems to crash running 2.2.2 (under windows)... 

int main(int argc, char* argv[])
{
   Py_Initialize();
   {
      char * crash_it = 
         "class anyclass:\n"
         "   def anyfunc(self,info):\n"
         "      pass\n";

      char * dont_crash_it =  
         "class anyclass:\n"
         "      pass\n";

      PyObject * dict = PyDict_New();
      PyDict_SetItemString( dict, "__builtins__", PyEval_GetBuiltins() );
      PyObject * rslt = PyRun_String( crash_it, Py_file_input, dict, dict );
      Py_DECREF(rslt);
      Py_DECREF(dict);
   }
   Py_Finalize();

   Py_Initialize(); // this fails

   return 0;
}

Can anyone see anything wrong with this? Is this a known problem?




More information about the Python-list mailing list