CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions
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 edm::hlt::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().

6  {
7  using namespace boost::python;
8  PyObject *exc, *val, *trace;
9  PyErr_Fetch(&exc,&val,&trace);
10  handle<> hExc(allow_null(exc));
11  if(hExc) {
12  object oExc(hExc);
13  }
14  handle<> hVal(allow_null(val));
15  handle<> hTrace(allow_null(trace));
16  if(hTrace) {
17  object oTrace(hTrace);
18  }
19 
20  if(hVal) {
21  object oVal(hVal);
22  handle<> hStringVal(PyObject_Str(oVal.ptr()));
23  object stringVal( hStringVal );
24 
25  //PyErr_Print();
26  throw cms::Exception(iType) <<"python encountered the error: "<< PyString_AsString(stringVal.ptr())<<"\n";
27  } else {
28  throw cms::Exception(iType)<<" unknown python problem occurred.\n";
29  }
30  }
double trace(const ROOT::Math::SMatrix< double, N, N > &matrix)