Skip to content

Commit 567ae36

Browse files
chrisburrguitargeek
authored andcommitted
fix: remove Py_single_input macro redefinition in PyMethodBase.h
Remove the `#define Py_single_input 256` from the public header to avoid a `-Wmacro-redefined` warning when CPython's compile.h is included after the precompiled header already defines the macro. The default argument now uses the literal value with a comment.
1 parent 77eb974 commit 567ae36

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

tmva/pymva/inc/TMVA/PyMethodBase.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class TH1D;
3434
#ifndef PyObject_HEAD
3535
struct _object;
3636
typedef _object PyObject;
37-
#define Py_single_input 256
3837
#endif
3938

4039
namespace TMVA {
@@ -111,7 +110,7 @@ namespace TMVA {
111110
PyObject *fPyReturn; // python return data
112111

113112
protected:
114-
void PyRunString(TString code, TString errorMessage="Failed to run python code", int start=Py_single_input); // runs python code from string in local namespace with error handling
113+
void PyRunString(TString code, TString errorMessage="Failed to run python code", int start=256 /* Py_single_input */); // runs python code from string in local namespace with error handling
115114

116115
private:
117116
static PyObject *fModuleBuiltin;

0 commit comments

Comments
 (0)