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
1904ef84
Commit
1904ef84
authored
Mar 08, 2016
by
Marius Wachtler
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix thread.error pickling
this caused problems inside the multiprocessing module
parent
9b30997a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
7 deletions
+6
-7
from_cpython/Include/pyerrors.h
from_cpython/Include/pyerrors.h
+1
-1
from_cpython/Python/errors.c
from_cpython/Python/errors.c
+1
-1
src/runtime/builtin_modules/thread.cpp
src/runtime/builtin_modules/thread.cpp
+1
-5
test/tests/cPickle_test.py
test/tests/cPickle_test.py
+3
-0
No files found.
from_cpython/Include/pyerrors.h
View file @
1904ef84
...
...
@@ -249,7 +249,7 @@ PyAPI_FUNC(void) _PyErr_BadInternalCall(const char *filename, int lineno) PYSTON
/* Function to create a new exception */
PyAPI_FUNC
(
PyObject
*
)
PyErr_NewException
(
char
*
name
,
PyObject
*
base
,
PyObject
*
dict
)
PYSTON_NOEXCEPT
;
c
onst
c
har
*
name
,
PyObject
*
base
,
PyObject
*
dict
)
PYSTON_NOEXCEPT
;
PyAPI_FUNC
(
PyObject
*
)
PyErr_NewExceptionWithDoc
(
char
*
name
,
char
*
doc
,
PyObject
*
base
,
PyObject
*
dict
)
PYSTON_NOEXCEPT
;
PyAPI_FUNC
(
void
)
PyErr_WriteUnraisable
(
PyObject
*
)
PYSTON_NOEXCEPT
;
...
...
from_cpython/Python/errors.c
View file @
1904ef84
...
...
@@ -551,7 +551,7 @@ PyErr_Format(PyObject *exception, const char *format, ...)
PyObject
*
PyErr_NewException
(
char
*
name
,
PyObject
*
base
,
PyObject
*
dict
)
PyErr_NewException
(
c
onst
c
har
*
name
,
PyObject
*
base
,
PyObject
*
dict
)
{
char
*
dot
;
PyObject
*
modulename
=
NULL
;
...
...
src/runtime/builtin_modules/thread.cpp
View file @
1904ef84
...
...
@@ -244,11 +244,7 @@ void setupThread() {
thread_lock_cls
->
giveAttr
(
"locked_lock"
,
thread_lock_cls
->
getattr
(
internStringMortal
(
"locked"
)));
thread_lock_cls
->
freeze
();
ThreadError
=
BoxedClass
::
create
(
type_cls
,
Exception
,
NULL
,
Exception
->
attrs_offset
,
Exception
->
tp_weaklistoffset
,
Exception
->
tp_basicsize
,
false
,
"error"
);
ThreadError
->
giveAttr
(
"__module__"
,
boxString
(
"thread"
));
ThreadError
->
freeze
();
ThreadError
=
(
BoxedClass
*
)
PyErr_NewException
(
"thread.error"
,
NULL
,
NULL
);
thread_module
->
giveAttr
(
"error"
,
ThreadError
);
}
}
test/tests/cPickle_test.py
View file @
1904ef84
...
...
@@ -46,3 +46,6 @@ for obj in [(1, 2), "hello world", u"hola world", 1.0, 1j, 1L, 2, {1:2}, set([3]
import
cStringIO
StringIO
=
cPickle
.
loads
(
cPickle
.
dumps
(
cStringIO
.
StringIO
))
print
type
(
StringIO
())
import
thread
print
cPickle
.
loads
(
cPickle
.
dumps
(
thread
.
error
))
Boxiang Sun
@Daetalus
mentioned in commit
9404c04a
·
Sep 08, 2016
mentioned in commit
9404c04a
mentioned in commit 9404c04a590ce20c49a85ef26f8be3901441a367
Toggle commit list
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