Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
0ec6bd47
Commit
0ec6bd47
authored
Mar 9, 2014
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
py: Fix printing of type name.
parent
5e34909a
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
py/objexcept.c
+1
-1
1 addition, 1 deletion
py/objexcept.c
py/runtime.c
+4
-4
4 additions, 4 deletions
py/runtime.c
with
5 additions
and
5 deletions
py/objexcept.c
+
1
−
1
View file @
0ec6bd47
...
@@ -48,7 +48,7 @@ STATIC mp_obj_t mp_obj_exception_make_new(mp_obj_t type_in, uint n_args, uint n_
...
@@ -48,7 +48,7 @@ STATIC mp_obj_t mp_obj_exception_make_new(mp_obj_t type_in, uint n_args, uint n_
mp_obj_type_t
*
type
=
type_in
;
mp_obj_type_t
*
type
=
type_in
;
if
(
n_kw
!=
0
)
{
if
(
n_kw
!=
0
)
{
nlr_jump
(
mp_obj_new_exception_msg_varg
(
&
mp_type_TypeError
,
"%s does not take keyword arguments"
,
type
->
name
));
nlr_jump
(
mp_obj_new_exception_msg_varg
(
&
mp_type_TypeError
,
"%s does not take keyword arguments"
,
mp_obj_get_type_str
(
type_in
)
));
}
}
mp_obj_exception_t
*
o
=
m_new_obj_var
(
mp_obj_exception_t
,
mp_obj_t
,
n_args
);
mp_obj_exception_t
*
o
=
m_new_obj_var
(
mp_obj_exception_t
,
mp_obj_t
,
n_args
);
...
...
This diff is collapsed.
Click to expand it.
py/runtime.c
+
4
−
4
View file @
0ec6bd47
...
@@ -474,7 +474,7 @@ mp_obj_t rt_unary_op(int op, mp_obj_t arg) {
...
@@ -474,7 +474,7 @@ mp_obj_t rt_unary_op(int op, mp_obj_t arg) {
}
}
}
}
// TODO specify in error message what the operator is
// TODO specify in error message what the operator is
nlr_jump
(
mp_obj_new_exception_msg_varg
(
&
mp_type_TypeError
,
"bad operand type for unary operator: '%s'"
,
type
->
name
));
nlr_jump
(
mp_obj_new_exception_msg_varg
(
&
mp_type_TypeError
,
"bad operand type for unary operator: '%s'"
,
mp_obj_get_type_str
(
arg
)
));
}
}
}
}
...
@@ -721,7 +721,7 @@ mp_obj_t rt_call_function_n_kw(mp_obj_t fun_in, uint n_args, uint n_kw, const mp
...
@@ -721,7 +721,7 @@ mp_obj_t rt_call_function_n_kw(mp_obj_t fun_in, uint n_args, uint n_kw, const mp
if
(
type
->
call
!=
NULL
)
{
if
(
type
->
call
!=
NULL
)
{
return
type
->
call
(
fun_in
,
n_args
,
n_kw
,
args
);
return
type
->
call
(
fun_in
,
n_args
,
n_kw
,
args
);
}
else
{
}
else
{
nlr_jump
(
mp_obj_new_exception_msg_varg
(
&
mp_type_TypeError
,
"'%s' object is not callable"
,
type
->
name
));
nlr_jump
(
mp_obj_new_exception_msg_varg
(
&
mp_type_TypeError
,
"'%s' object is not callable"
,
mp_obj_get_type_str
(
fun_in
)
));
}
}
}
}
...
@@ -927,7 +927,7 @@ mp_obj_t rt_getiter(mp_obj_t o_in) {
...
@@ -927,7 +927,7 @@ mp_obj_t rt_getiter(mp_obj_t o_in) {
return
mp_obj_new_getitem_iter
(
dest
);
return
mp_obj_new_getitem_iter
(
dest
);
}
else
{
}
else
{
// object not iterable
// object not iterable
nlr_jump
(
mp_obj_new_exception_msg_varg
(
&
mp_type_TypeError
,
"'%s' object is not iterable"
,
type
->
name
));
nlr_jump
(
mp_obj_new_exception_msg_varg
(
&
mp_type_TypeError
,
"'%s' object is not iterable"
,
mp_obj_get_type_str
(
o_in
)
));
}
}
}
}
}
}
...
@@ -937,7 +937,7 @@ mp_obj_t rt_iternext(mp_obj_t o_in) {
...
@@ -937,7 +937,7 @@ mp_obj_t rt_iternext(mp_obj_t o_in) {
if
(
type
->
iternext
!=
NULL
)
{
if
(
type
->
iternext
!=
NULL
)
{
return
type
->
iternext
(
o_in
);
return
type
->
iternext
(
o_in
);
}
else
{
}
else
{
nlr_jump
(
mp_obj_new_exception_msg_varg
(
&
mp_type_TypeError
,
"'%s' object is not an iterator"
,
type
->
name
));
nlr_jump
(
mp_obj_new_exception_msg_varg
(
&
mp_type_TypeError
,
"'%s' object is not an iterator"
,
mp_obj_get_type_str
(
o_in
)
));
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment