Commit 1e516e5d authored by Kevin Modzelewski's avatar Kevin Modzelewski

refcounting fix

parent 5e858cec
......@@ -2182,7 +2182,8 @@ void setupBuiltins() {
{ "print", (PyCFunction)builtin_print, METH_VARARGS | METH_KEYWORDS, print_doc },
};
for (auto& md : builtin_methods) {
builtins_module->giveAttr(md.ml_name, new BoxedCApiFunction(&md, builtins_module, boxString("__builtin__")));
builtins_module->giveAttr(md.ml_name,
new BoxedCApiFunction(&md, builtins_module, autoDecref(boxString("__builtin__"))));
}
}
}
......@@ -744,8 +744,9 @@ void setupSys() {
sys_flags_cls->freeze();
auto sys_str = getStaticString("sys");
for (auto& md : sys_methods) {
sys_module->giveAttr(md.ml_name, new BoxedCApiFunction(&md, sys_module, boxString("sys")));
sys_module->giveAttr(md.ml_name, new BoxedCApiFunction(&md, sys_module, sys_str));
}
sys_module->giveAttrBorrowed("__displayhook__", sys_module->getattr(autoDecref(internStringMortal("displayhook"))));
......
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