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
298c835c
Commit
298c835c
authored
Mar 30, 2016
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a couple CAPI-only bugs
parent
3b9ca8a5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
from_cpython/Objects/exceptions.c
from_cpython/Objects/exceptions.c
+3
-0
src/runtime/types.cpp
src/runtime/types.cpp
+1
-0
No files found.
from_cpython/Objects/exceptions.c
View file @
298c835c
...
...
@@ -37,6 +37,7 @@ BaseException_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
if
(
!
self
)
return
NULL
;
self
->
message
=
NULL
;
// Pyston change:
PyObject_InitHcAttrs
(
&
self
->
hcattrs
);
self
->
args
=
PyTuple_New
(
0
);
...
...
@@ -72,6 +73,7 @@ BaseException_init(PyBaseExceptionObject *self, PyObject *args, PyObject *kwds)
return
0
;
}
// Pyston addition:
PyObject
*
PyErr_CreateExceptionInstance
(
PyObject
*
_type
,
PyObject
*
arg
)
{
if
(
PyType_Check
(
_type
)
&&
((
PyTypeObject
*
)
_type
)
->
tp_new
==
(
newfunc
)
BaseException_new
&&
((
PyTypeObject
*
)
_type
)
->
tp_init
==
(
initproc
)
BaseException_init
)
{
...
...
@@ -91,6 +93,7 @@ PyObject* PyErr_CreateExceptionInstance(PyObject* _type, PyObject* arg) {
Py_DECREF
(
self
);
return
NULL
;
}
Py_INCREF
(
arg
);
self
->
message
=
arg
;
}
else
{
self
->
args
=
PyTuple_New
(
0
);
...
...
src/runtime/types.cpp
View file @
298c835c
...
...
@@ -1247,6 +1247,7 @@ static Box* typeCallInner(CallRewriteArgs* rewrite_args, ArgPassSpec argspec, Bo
PyErr_Format
(
TypeError
,
"__init__() should return None, not '%s'"
,
getTypeName
(
autoDecref
(
initrtn
)));
return
NULL
;
}
Py_DECREF
(
initrtn
);
}
else
made
=
assertInitNone
(
initrtn
,
made
);
// assertInitNone is optimized for the rewriter case; this call
// here could be improved if it is an issue.
...
...
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