Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
472aeb9c
Commit
472aeb9c
authored
Dec 16, 2014
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support the Get/SetDefaultEncoding api functions
parent
bf2e77ec
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
4 deletions
+14
-4
src/runtime/capi.cpp
src/runtime/capi.cpp
+0
-4
src/runtime/unicode.cpp
src/runtime/unicode.cpp
+10
-0
test/tests/os_test.py
test/tests/os_test.py
+4
-0
No files found.
src/runtime/capi.cpp
View file @
472aeb9c
...
...
@@ -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"
);
}
...
...
src/runtime/unicode.cpp
View file @
472aeb9c
...
...
@@ -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"
);
}
...
...
test/tests/os_test.py
View file @
472aeb9c
...
...
@@ -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"
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment