Mod: change error text of Python wrapper when trying to access deleted view
This commit is contained in:
@@ -504,8 +504,11 @@ Py::Object SheetViewPy::repr()
|
||||
// appear for SheetViewPy, too.
|
||||
Py::Object SheetViewPy::getattr(const char * attr)
|
||||
{
|
||||
if (!getSheetViewPtr())
|
||||
throw Py::RuntimeError("Cannot print representation of deleted object");
|
||||
if (!getSheetViewPtr()) {
|
||||
std::ostringstream s_out;
|
||||
s_out << "Cannot access attribute '" << attr << "' of deleted object";
|
||||
throw Py::RuntimeError(s_out.str());
|
||||
}
|
||||
std::string name( attr );
|
||||
if (name == "__dict__" || name == "__class__") {
|
||||
Py::Dict dict_self(BaseType::getattr("__dict__"));
|
||||
|
||||
@@ -1415,8 +1415,11 @@ Py::Object MDIViewPagePy::repr()
|
||||
// appear for SheetViewPy, too.
|
||||
Py::Object MDIViewPagePy::getattr(const char * attr)
|
||||
{
|
||||
if (!getMDIViewPagePtr())
|
||||
throw Py::RuntimeError("Cannot print representation of deleted object");
|
||||
if (!getMDIViewPagePtr()) {
|
||||
std::ostringstream s_out;
|
||||
s_out << "Cannot access attribute '" << attr << "' of deleted object";
|
||||
throw Py::RuntimeError(s_out.str());
|
||||
}
|
||||
std::string name( attr );
|
||||
if (name == "__dict__" || name == "__class__") {
|
||||
Py::Dict dict_self(BaseType::getattr("__dict__"));
|
||||
|
||||
@@ -240,8 +240,11 @@ Py::Object BrowserViewPy::repr()
|
||||
// appear for SheetViewPy, too.
|
||||
Py::Object BrowserViewPy::getattr(const char * attr)
|
||||
{
|
||||
if (!getBrowserViewPtr())
|
||||
throw Py::RuntimeError("Cannot print representation of deleted object");
|
||||
if (!getBrowserViewPtr()) {
|
||||
std::ostringstream s_out;
|
||||
s_out << "Cannot access attribute '" << attr << "' of deleted object";
|
||||
throw Py::RuntimeError(s_out.str());
|
||||
}
|
||||
std::string name( attr );
|
||||
if (name == "__dict__" || name == "__class__") {
|
||||
Py::Dict dict_self(BaseType::getattr("__dict__"));
|
||||
|
||||
Reference in New Issue
Block a user