Commit 032b0dd7 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Get test_thread.py working

parent f17f3b0d
# expected: fail
import os
import unittest
import random
......
......@@ -198,8 +198,14 @@ Box* getIdent() {
return boxInt(pthread_self());
}
Box* stackSize() {
Py_FatalError("unimplemented");
Box* stackSize(Box* arg) {
if (arg) {
if (PyInt_Check(arg) && PyInt_AS_LONG(arg) == 0) {
Py_RETURN_NONE;
}
raiseExcHelper(ThreadError, "Changing initial stack size is not supported in Pyston");
}
return boxInt(0);
}
Box* threadCount() {
......@@ -227,7 +233,7 @@ void setupThread() {
thread_module->giveAttr(
"get_ident", new BoxedBuiltinFunctionOrMethod(BoxedCode::create((void*)getIdent, BOXED_INT, 0, "get_ident")));
thread_module->giveAttr("stack_size", new BoxedBuiltinFunctionOrMethod(
BoxedCode::create((void*)stackSize, BOXED_INT, 0, "stack_size")));
BoxedCode::create((void*)stackSize, UNKNOWN, 1, "stack_size"), { NULL }));
thread_module->giveAttr(
"_count", new BoxedBuiltinFunctionOrMethod(BoxedCode::create((void*)threadCount, BOXED_INT, 0, "_count")));
......
......@@ -147,7 +147,6 @@ test_sys we're missing some attributes in the sys module (call_tr
test_tcl [unknown]
test_threading_local [unknown]
test_threading [unknown]
test_thread [unknown]
test_tk [unknown]
test_tools [unknown]
test_traceback [unknown]
......
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