Mantid
Loading...
Searching...
No Matches
Framework
PythonInterface
core
src
UninstallTrace.cpp
Go to the documentation of this file.
1
// Mantid Repository : https://github.com/mantidproject/mantid
2
//
3
// Copyright © 2020 ISIS Rutherford Appleton Laboratory UKRI,
4
// NScD Oak Ridge National Laboratory, European Spallation Source,
5
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6
// SPDX - License - Identifier: GPL - 3.0 +
7
#include "
MantidPythonInterface/core/UninstallTrace.h
"
8
9
namespace
Mantid::PythonInterface
{
10
15
UninstallTrace::UninstallTrace
() {
16
PyThreadState *curThreadState = PyThreadState_GET();
17
m_tracefunc
= curThreadState->c_tracefunc;
18
m_tracearg
= curThreadState->c_traceobj;
19
Py_XINCREF(
m_tracearg
);
20
PyEval_SetTrace(
nullptr
,
nullptr
);
21
}
22
27
UninstallTrace::~UninstallTrace
() { PyEval_SetTrace(
m_tracefunc
,
m_tracearg
); }
28
29
}
// namespace Mantid::PythonInterface
UninstallTrace.h
Mantid::PythonInterface::UninstallTrace::m_tracefunc
Py_tracefunc m_tracefunc
Definition:
UninstallTrace.h:24
Mantid::PythonInterface::UninstallTrace::~UninstallTrace
~UninstallTrace()
Reinstates any trace function with PyEval_SetTrace and any saved arguments from the constructor.
Definition:
UninstallTrace.cpp:27
Mantid::PythonInterface::UninstallTrace::UninstallTrace
UninstallTrace()
Saves any function and argument previously set by PyEval_SetTrace and calls PyEval_SetTrace(nullptr,...
Definition:
UninstallTrace.cpp:15
Mantid::PythonInterface::UninstallTrace::m_tracearg
PyObject * m_tracearg
Definition:
UninstallTrace.h:25
Mantid::PythonInterface
Definition:
CallMethod.h:17
Generated on Tue Jan 3 2023 11:57:58 for Mantid by
1.9.5