Commit 470ebe02 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Fix a couple missed things

parent 52fe1669
......@@ -126,8 +126,7 @@ extern "C" PyObject* PyImport_ExecCodeModuleEx(const char* name, PyObject* co, c
}
extern "C" Box* import(int level, Box* from_imports, llvm::StringRef module_name) {
Box* rtn = PyImport_ImportModuleLevel(module_name.str().c_str(), autoDecref(getGlobalsDict()), NULL, from_imports,
level);
Box* rtn = PyImport_ImportModuleLevel(module_name.str().c_str(), getGlobalsDict(), NULL, from_imports, level);
if (!rtn)
throwCAPIException();
return rtn;
......
......@@ -1187,6 +1187,7 @@ static void freeAttrs(HCAttrs::AttrList* attrs, int nattrs) {
// TODO: should drop an old item from the freelist, not a new one
if (size == ARRAYLIST_FREELIST_SIZE) {
PyObject_FREE(attrs);
return;
} else {
#ifndef NDEBUG
memset(attrs, 0xdb, sizeof(HCAttrs::AttrList) + nattrs * sizeof(Box*));
......@@ -6678,7 +6679,6 @@ Box* _typeNew(BoxedClass* metatype, BoxedString* name, BoxedTuple* bases, BoxedD
static BoxedString* module_str = getStaticString("__module__");
if (!made->hasattr(module_str)) {
Box* gl = getGlobalsDict();
AUTO_DECREF(gl);
static BoxedString* name_str = getStaticString("__name__");
Box* attr = PyDict_GetItem(gl, name_str);
if (attr)
......
......@@ -1399,7 +1399,6 @@ extern "C" Box* createUserClass(BoxedString* name, Box* _bases, Box* _attr_dict)
metaclass = bases->elts[0]->cls;
} else {
Box* gl = getGlobalsDict();
AUTO_DECREF(gl);
metaclass = PyDict_GetItemString(gl, "__metaclass__");
if (!metaclass) {
......
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