Commit 7b0aaa97 authored by miller86's avatar miller86

2.7RC->Trunk, resolve #1647, clear python error upon failed attempt to call...

2.7RC->Trunk, resolve #1647, clear python error upon failed attempt to call setattr in state object base class

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@22897 18c085ea-50e0-402c-830e-de6fd14e8384
parent 0d56b9c2
......@@ -2774,6 +2774,10 @@ class PythonFieldFactory
// Mark C. Miller, Wed Aug 26 10:55:31 PDT 2009
// Added support for a custom base class to support derived state objects.
// Added logic to count methods in method table without writing them.
//
// Mark C. Miller, Mon Feb 24 12:17:15 PST 2014
// Added logic to clear python error after attempting and failing to
// _setattr in a custom base.
// ----------------------------------------------------------------------------
#include <GeneratorBase.h>
......@@ -3081,6 +3085,8 @@ class PythonGeneratorAttribute : public GeneratorBase
{
c << " if (Py"<<baseClass<<"_setattr(self, name, args) != -1)" << Endl;
c << " return 0;" << Endl;
c << " else" << Endl;
c << " PyErr_Clear();" << Endl;
c << Endl;
}
if(HasCode(mName, 0))
......
......@@ -258,6 +258,8 @@ PyavtArrayMetaData_setattr(PyObject *self, char *name, PyObject *args)
{
if (PyavtVarMetaData_setattr(self, name, args) != -1)
return 0;
else
PyErr_Clear();
// Create a tuple to contain the arguments since all of the Set
// functions expect a tuple.
......
......@@ -402,6 +402,8 @@ PyavtCurveMetaData_setattr(PyObject *self, char *name, PyObject *args)
{
if (PyavtVarMetaData_setattr(self, name, args) != -1)
return 0;
else
PyErr_Clear();
// Create a tuple to contain the arguments since all of the Set
// functions expect a tuple.
......
......@@ -159,6 +159,8 @@ PyavtLabelMetaData_setattr(PyObject *self, char *name, PyObject *args)
{
if (PyavtVarMetaData_setattr(self, name, args) != -1)
return 0;
else
PyErr_Clear();
// Create a tuple to contain the arguments since all of the Set
// functions expect a tuple.
......
......@@ -327,6 +327,8 @@ PyavtMaterialMetaData_setattr(PyObject *self, char *name, PyObject *args)
{
if (PyavtBaseVarMetaData_setattr(self, name, args) != -1)
return 0;
else
PyErr_Clear();
// Create a tuple to contain the arguments since all of the Set
// functions expect a tuple.
......
......@@ -924,6 +924,8 @@ PyavtScalarMetaData_setattr(PyObject *self, char *name, PyObject *args)
{
if (PyavtVarMetaData_setattr(self, name, args) != -1)
return 0;
else
PyErr_Clear();
// Create a tuple to contain the arguments since all of the Set
// functions expect a tuple.
......
......@@ -725,6 +725,8 @@ PyavtSubsetsMetaData_setattr(PyObject *self, char *name, PyObject *args)
{
if (PyavtVarMetaData_setattr(self, name, args) != -1)
return 0;
else
PyErr_Clear();
// Create a tuple to contain the arguments since all of the Set
// functions expect a tuple.
......
......@@ -189,6 +189,8 @@ PyavtSymmetricTensorMetaData_setattr(PyObject *self, char *name, PyObject *args)
{
if (PyavtVarMetaData_setattr(self, name, args) != -1)
return 0;
else
PyErr_Clear();
// Create a tuple to contain the arguments since all of the Set
// functions expect a tuple.
......
......@@ -189,6 +189,8 @@ PyavtTensorMetaData_setattr(PyObject *self, char *name, PyObject *args)
{
if (PyavtVarMetaData_setattr(self, name, args) != -1)
return 0;
else
PyErr_Clear();
// Create a tuple to contain the arguments since all of the Set
// functions expect a tuple.
......
......@@ -457,6 +457,8 @@ PyavtVarMetaData_setattr(PyObject *self, char *name, PyObject *args)
{
if (PyavtBaseVarMetaData_setattr(self, name, args) != -1)
return 0;
else
PyErr_Clear();
// Create a tuple to contain the arguments since all of the Set
// functions expect a tuple.
......
......@@ -189,6 +189,8 @@ PyavtVectorMetaData_setattr(PyObject *self, char *name, PyObject *args)
{
if (PyavtVarMetaData_setattr(self, name, args) != -1)
return 0;
else
PyErr_Clear();
// Create a tuple to contain the arguments since all of the Set
// functions expect a tuple.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment