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
b0959d9e
Commit
b0959d9e
authored
Mar 22, 2016
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix python package import and deregister codecs
parent
12d0e51e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
src/capi/codecs.cpp
src/capi/codecs.cpp
+9
-0
src/runtime/types.cpp
src/runtime/types.cpp
+7
-4
No files found.
src/capi/codecs.cpp
View file @
b0959d9e
...
...
@@ -781,6 +781,15 @@ static int _PyCodecRegistry_Init(void) {
Py_DECREF
(
mod
);
return
0
;
}
// Pyston addition:
int
_PyCodecRegistry_Deinit
(
void
)
{
Py_CLEAR
(
interp
->
codec_search_path
);
Py_CLEAR
(
interp
->
codec_search_cache
);
Py_CLEAR
(
interp
->
codec_error_registry
);
return
0
;
}
}
}
// namespace pyston
src/runtime/types.cpp
View file @
b0959d9e
...
...
@@ -647,7 +647,6 @@ static PyObject* cpythonTypeCall(BoxedClass* type, PyObject* args, PyObject* kwd
}
static
Box
*
unicodeNewHelper
(
BoxedClass
*
type
,
Box
*
string
,
Box
*
encoding_obj
,
Box
**
_args
)
{
assert
(
0
&&
"check refcounting"
);
Box
*
errors_obj
=
_args
[
0
];
assert
(
isSubclass
(
type
,
unicode_cls
));
...
...
@@ -699,8 +698,10 @@ static Box* unicodeNewHelper(BoxedClass* type, Box* string, Box* encoding_obj, B
AUTO_DECREF
(
args
);
int
init_code
=
r
->
cls
->
tp_init
(
r
,
args
,
NULL
);
if
(
init_code
==
-
1
)
if
(
init_code
==
-
1
)
{
Py_DECREF
(
r
);
throwCAPIException
();
}
return
r
;
}
...
...
@@ -4696,7 +4697,6 @@ BORROWED(BoxedModule*) createModule(BoxedString* name, const char* fn, const cha
Box
*
existing
=
d
->
getOrNull
(
name
);
if
(
existing
&&
PyModule_Check
(
existing
))
{
module
=
static_cast
<
BoxedModule
*>
(
existing
);
Py_INCREF
(
module
);
}
else
{
module
=
new
BoxedModule
();
autoDecref
(
moduleInit
(
module
,
name
,
autoDecref
(
boxString
(
doc
?
doc
:
""
))));
...
...
@@ -4732,6 +4732,9 @@ static void call_sys_exitfunc(void) {
PyErr_Clear
();
}
// this is a pyston addition defined in codecs.cpp
extern
"C"
int
_PyCodecRegistry_Deinit
(
void
)
noexcept
;
extern
"C"
void
Py_Finalize
()
noexcept
{
// In the future this will have to wait for non-daemon
// threads to finish
...
...
@@ -4748,7 +4751,7 @@ extern "C" void Py_Finalize() noexcept {
PyGC_Collect
();
// To make sure it creates any static objects
IN_SHUTDOWN
=
true
;
PyOS_FiniInterrupts
();
_PyCodecRegistry_Deinit
();
// TODO: we might have to do this in a loop:
PyType_ClearCache
();
_PyUnicode_Fini
();
...
...
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