/usr/include/root/TPyException.h is in libroot-bindings-python-dev 5.34.14-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | // @(#)root/pyroot:$Name: $:$Id$
// Author: Scott Snyder, Apr 2004
#ifndef ROOT_TPyException
#define ROOT_TPyException
//////////////////////////////////////////////////////////////////////////////
// //
// TPyException //
// //
// Purpose: A C++ exception class for throwing python exceptions //
// through C++ code. //
// Created: Apr, 2004, sss, from the version in D0's python_util. //
// //
// The situation is: //
// - We're calling ROOT C++ code from python. //
// - The C++ code can call back to python. //
// - What to do then if the python callback throws an exception? //
// //
// We need to get the control flow back to where PyROOT makes the ROOT call.//
// To do that we throw a TPyException. //
// We can then catch this exception when we do the ROOT call. //
// //
// Note that we don't need to save any state in the exception -- it's //
// already in the python error info variables. //
// (??? Actually, if the program is multithreaded, this is dangerous //
// if the code has released and reacquired the lock along the call chain. //
// Punt on this for now, though.) //
// //
//////////////////////////////////////////////////////////////////////////////
// ROOT
#ifndef ROOT_DllImport
#include "DllImport.h"
#endif
#ifndef ROOT_Rtypes
#include "Rtypes.h"
#endif
// Standard
#include <exception>
namespace PyROOT {
R__EXTERN void* TPyExceptionMagic;
class TPyException : public std::exception {
public:
// default constructor
TPyException();
// destructor
virtual ~TPyException() throw();
// give reason for raised exception
virtual const char* what() const throw();
ClassDef(TPyException,0) //C++ exception for throwing python exceptions
};
} // namespace PyROOT
#if defined(G__DICTIONARY) && defined(R__SOLARIS)
// Force the inclusion of rw/math.h
#include <limits>
// Work around interaction between a struct named exception in math.h,
// std::exception and the use of using namespace std;
#if (__SUNPRO_CC < 0x5050)
#define exception std::exception
#endif
#endif
#endif
|