Merge branch 'amaeldoe-master'
* amaeldoe-master: Add python runtime test for dynamically added attributes Attribute of SWIG wrapped classes instances were overwritten on __init__() Fix SwigPyObject->dict memory leak Make __dict__ accessible for Python builtin classes
This commit is contained in:
commit
b886a54fce
4 changed files with 56 additions and 3 deletions
|
|
@ -3058,6 +3058,17 @@ public:
|
|||
}
|
||||
|
||||
/* If this is a builtin type, create a PyGetSetDef entry for this member variable. */
|
||||
if (builtin) {
|
||||
const char *memname = "__dict__";
|
||||
Hash *h = Getattr(builtin_getset, memname);
|
||||
if (!h) {
|
||||
h = NewHash();
|
||||
Setattr(builtin_getset, memname, h);
|
||||
Delete(h);
|
||||
}
|
||||
Setattr(h, "getter", "SwigPyObject_get___dict__");
|
||||
}
|
||||
|
||||
if (builtin_getter) {
|
||||
String *memname = Getattr(n, "membervariableHandler:sym:name");
|
||||
if (!memname)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue