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
6f7629b4
Commit
6f7629b4
authored
Mar 10, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make this closer to CPython
parent
ae2e484d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
src/runtime/types.cpp
src/runtime/types.cpp
+16
-15
No files found.
src/runtime/types.cpp
View file @
6f7629b4
...
...
@@ -596,24 +596,25 @@ extern "C" Box* createUserClass(const std::string* name, Box* _bases, Box* _attr
RELEASE_ASSERT
(
r
,
""
);
return
r
;
}
catch
(
ExcInfo
e
)
{
// TODO [CAPI] bad error handling...
RELEASE_ASSERT
(
e
.
matches
(
BaseException
),
""
);
Box
*
msg
=
getattr
(
e
.
value
,
"message"
);
RELEASE_ASSERT
(
msg
,
""
);
RELEASE_ASSERT
(
msg
->
cls
==
str_cls
,
""
);
PyObject
*
newmsg
;
newmsg
=
PyString_FromFormat
(
"Error when calling the metaclass bases
\n
"
" %s"
,
PyString_AS_STRING
(
msg
));
PyErr_Restore
(
e
.
type
,
newmsg
,
NULL
);
checkAndThrowCAPIException
();
Box
*
msg
=
e
.
value
;
assert
(
msg
);
// TODO this is an extra Pyston check and I don't think we should have to do it:
if
(
isSubclass
(
e
.
value
->
cls
,
BaseException
))
msg
=
getattr
(
e
.
value
,
"message"
);
if
(
isSubclass
(
msg
->
cls
,
str_cls
))
{
auto
newmsg
=
PyString_FromFormat
(
"Error when calling the metaclass bases
\n
"
" %s"
,
PyString_AS_STRING
(
msg
));
if
(
newmsg
)
e
.
value
=
newmsg
;
}
// Should not reach here
abort
();
// Go through these routines since they do some normalization:
PyErr_Restore
(
e
.
type
,
e
.
value
,
NULL
);
throwCAPIException
();
}
}
...
...
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