Commit 472aeb9c authored by Kevin Modzelewski's avatar Kevin Modzelewski

Support the Get/SetDefaultEncoding api functions

parent bf2e77ec
......@@ -771,10 +771,6 @@ extern "C" const char* PyUnicode_AS_DATA(PyObject*) {
Py_FatalError("unimplemented");
}
extern "C" const char* PyUnicode_GetDefaultEncoding(void) {
Py_FatalError("unimplemented");
}
extern "C" int PyBuffer_IsContiguous(Py_buffer* view, char fort) {
Py_FatalError("unimplemented");
}
......
......@@ -18,6 +18,16 @@ namespace pyston {
// capi stuff
static std::string unicode_default_encoding = "ascii";
extern "C" const char* PyUnicode_GetDefaultEncoding(void) {
return unicode_default_encoding.c_str();
}
extern "C" int PyUnicode_SetDefaultEncoding(const char* encoding) {
unicode_default_encoding = encoding;
return 0;
}
extern "C" int PyUnicode_ClearFreeList() {
Py_FatalError("unimplemented");
}
......
......@@ -8,3 +8,7 @@ import os
r1 = os.urandom(8)
r2 = os.urandom(8)
print len(r1), len(r2), type(r1), type(r2), r1 == r2
print type(os.stat("/dev/null"))
print os.path.expanduser("~") == os.environ["HOME"]
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