Commit 9b5036b9 authored by Travis Hance's avatar Travis Hance

got import operator to work

parent 89ecda8a
// This file is originally from CPython 2.7, with modifications for Pyston
#include "Python.h"
......@@ -913,6 +914,9 @@ initoperator(void)
if (m == NULL)
return;
/* Pyston TODO: un-comment these when we have the functionality to
* support them.
if (PyType_Ready(&itemgetter_type) < 0)
return;
Py_INCREF(&itemgetter_type);
......@@ -927,4 +931,5 @@ initoperator(void)
return;
Py_INCREF(&methodcaller_type);
PyModule_AddObject(m, "methodcaller", (PyObject *)&methodcaller_type);
*/
}
......@@ -823,8 +823,7 @@ void setupRuntime() {
init_md5();
init_sre();
initmath();
// TODO enable this
// initoperator();
initoperator();
setupSysEnd();
......
# expected: fail
import operator
print operator.methodcaller
print operator.itemgetter
print operator.attrgetter
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