CMS 3D CMS Logo

PythonManager.h File Reference

#include "FWCore/ParameterSet/interface/BoostPython.h"
#include "FWCore/Utilities/interface/Exception.h"

Go to the source code of this file.

Functions

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


Function Documentation

void initlibFWCorePython (  ) 

void @7650::pythonToCppException ( const std::string &  iType  )  [static]

Definition at line 23 of file PythonManager.h.

References Exception, and GsfMatrixTools::trace().

Referenced by PythonFilter::filter(), PythonService::postBeginJob(), PythonService::postEndJob(), PythonService::postProcessEvent(), and PythonFilter::PythonFilter().

00024     {
00025        using namespace boost::python;
00026        PyObject *exc, *val, *trace;
00027        PyErr_Fetch(&exc,&val,&trace);
00028        handle<> hExc(allow_null(exc));
00029        if(hExc) {
00030           object oExc(hExc);
00031        }
00032        handle<> hVal(allow_null(val));
00033        handle<> hTrace(allow_null(trace));
00034        if(hTrace) {
00035           object oTrace(hTrace);
00036        }
00037 
00038        if(hVal) {
00039           object oVal(hVal);
00040           handle<> hStringVal(PyObject_Str(oVal.ptr()));
00041           object stringVal( hStringVal );
00042 
00043           //PyErr_Print();
00044           throw cms::Exception(iType) <<"python encountered the error: "<< PyString_AsString(stringVal.ptr())<<"\n";
00045        } else {
00046           throw cms::Exception(iType)<<" unknown python problem occurred.\n";
00047        }
00048     }


Variable Documentation

std::string initCommand_

Definition at line 63 of file PythonManager.h.

PythonManager& manager_

Definition at line 82 of file PythonManager.h.

unsigned long refCount_

Definition at line 62 of file PythonManager.h.


Generated on Tue Jun 9 17:53:32 2009 for CMSSW by  doxygen 1.5.4