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
8b56beb1
Commit
8b56beb1
authored
Jan 31, 2014
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
py: Simplified rt_call_function_n_kw.
parent
f3b05449
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
py/runtime.c
+7
-10
7 additions, 10 deletions
py/runtime.c
with
7 additions
and
10 deletions
py/runtime.c
+
7
−
10
View file @
8b56beb1
...
@@ -737,17 +737,14 @@ mp_obj_t rt_call_function_n_kw(mp_obj_t fun_in, uint n_args, uint n_kw, const mp
...
@@ -737,17 +737,14 @@ mp_obj_t rt_call_function_n_kw(mp_obj_t fun_in, uint n_args, uint n_kw, const mp
DEBUG_OP_printf
(
"calling function %p(n_args=%d, n_kw=%d, args=%p)
\n
"
,
fun_in
,
n_args
,
n_kw
,
args
);
DEBUG_OP_printf
(
"calling function %p(n_args=%d, n_kw=%d, args=%p)
\n
"
,
fun_in
,
n_args
,
n_kw
,
args
);
if
(
MP_OBJ_IS_SMALL_INT
(
fun_in
))
{
// get the type
nlr_jump
(
mp_obj_new_exception_msg
(
MP_QSTR_TypeError
,
"'int' object is not callable"
));
mp_obj_type_t
*
type
=
mp_obj_get_type
(
fun_in
);
}
else
if
(
MP_OBJ_IS_STR
(
fun_in
))
{
nlr_jump
(
mp_obj_new_exception_msg
(
MP_QSTR_TypeError
,
"'str' object is not callable"
));
// do the call
}
else
{
if
(
type
->
call
!=
NULL
)
{
mp_obj_base_t
*
fun
=
fun_in
;
return
type
->
call
(
fun_in
,
n_args
,
n_kw
,
args
);
if
(
fun
->
type
->
call
!=
NULL
)
{
return
fun
->
type
->
call
(
fun_in
,
n_args
,
n_kw
,
args
);
}
else
{
}
else
{
nlr_jump
(
mp_obj_new_exception_msg_varg
(
MP_QSTR_TypeError
,
"'%s' object is not callable"
,
fun
->
type
->
name
));
nlr_jump
(
mp_obj_new_exception_msg_varg
(
MP_QSTR_TypeError
,
"'%s' object is not callable"
,
type
->
name
));
}
}
}
}
}
...
...
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