CMS 3D CMS Logo

Classes | Functions

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/FWCore/Python/src/PythonManager.h File Reference

#include "FWCore/PythonParameterSet/interface/BoostPython.h"

Go to the source code of this file.

Classes

class  PythonManager
class  PythonManagerHandle

Functions

void initlibFWCorePython ()
void pythonToCppException (const std::string &iType)

Function Documentation

void initlibFWCorePython ( )
void pythonToCppException ( const std::string &  iType)

Definition at line 5 of file PythonManager.cc.

References Exception, NULL, and GsfMatrixTools::trace().

Referenced by PythonFilter::filter(), PythonService::postBeginJob(), PythonService::postEndJob(), PythonService::postProcessEvent(), edm::pythonFileToConfigure(), PythonFilter::PythonFilter(), PythonProcessDesc::read(), edm::readPSetsFrom(), and FWPathsPopup::scheduleReloadEvent().

    {
       using namespace boost::python;
       PyObject *exc, *val, *trace;
       PyErr_Fetch(&exc,&val,&trace);
       handle<> hExc(allow_null(exc));
       if(hExc) {
          object oExc(hExc);
       }
       handle<> hVal(allow_null(val));
       handle<> hTrace(allow_null(trace));
       if(hTrace) {
          object oTrace(hTrace);
       }

       if(hVal) {
          object oVal(hVal);
          handle<> hStringVal(PyObject_Str(oVal.ptr()));
          object stringVal( hStringVal );

          //PyErr_Print();
          throw cms::Exception(iType) <<"python encountered the error: "<< PyString_AsString(stringVal.ptr())<<"\n";
       } else {
          throw cms::Exception(iType)<<" unknown python problem occurred.\n";
       }
    }