+ Avoid to unnecessarily throw Py::Exception

This commit is contained in:
wmayer
2014-02-22 11:35:51 +01:00
parent f8cd87a696
commit 11ebf1deb7
3 changed files with 75 additions and 33 deletions

View File

@@ -57,6 +57,15 @@ PythonStdout::~PythonStdout()
{
}
Py::Object PythonStdout::getattr(const char *name)
{
if (strcmp(name, "softspace") == 0) {
int i=0;
return Py::Int(i);
}
return getattr_methods(name);
}
Py::Object PythonStdout::repr()
{
std::string s;
@@ -119,6 +128,15 @@ PythonStderr::~PythonStderr()
{
}
Py::Object PythonStderr::getattr(const char *name)
{
if (strcmp(name, "softspace") == 0) {
int i=0;
return Py::Int(i);
}
return getattr_methods(name);
}
Py::Object PythonStderr::repr()
{
std::string s;
@@ -180,6 +198,15 @@ OutputStdout::~OutputStdout()
{
}
Py::Object OutputStdout::getattr(const char *name)
{
if (strcmp(name, "softspace") == 0) {
int i=0;
return Py::Int(i);
}
return getattr_methods(name);
}
Py::Object OutputStdout::repr()
{
std::string s;
@@ -239,6 +266,15 @@ OutputStderr::~OutputStderr()
{
}
Py::Object OutputStderr::getattr(const char *name)
{
if (strcmp(name, "softspace") == 0) {
int i=0;
return Py::Int(i);
}
return getattr_methods(name);
}
Py::Object OutputStderr::repr()
{
std::string s;