support __bool__ on Python 2.x and 3.x

This commit is contained in:
Wenzel Jakob 2016-05-16 18:52:46 +02:00
parent 00c7d6ccc7
commit d1bfc4e0f8

View File

@ -200,6 +200,9 @@ protected:
if (strcmp(rec->name, "__next__") == 0) {
std::free(rec->name);
rec->name = strdup("next");
} else if (strcmp(rec->name, "__bool__") == 0) {
std::free(rec->name);
rec->name = strdup("__nonzero__");
}
#endif