Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
cc1c499b
Commit
cc1c499b
authored
Aug 31, 2016
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bare return for closure creation failure.
Re-use, rather than duplicate, error exit code.
parent
09f6874a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
21 deletions
+8
-21
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+8
-21
No files found.
Cython/Compiler/Nodes.py
View file @
cc1c499b
...
@@ -1848,28 +1848,15 @@ class FuncDefNode(StatNode, BlockNode):
...
@@ -1848,28 +1848,15 @@ class FuncDefNode(StatNode, BlockNode):
lenv
.
scope_class
.
type
.
typeptr_cname
,
lenv
.
scope_class
.
type
.
typeptr_cname
,
Naming
.
empty_tuple
))
Naming
.
empty_tuple
))
code
.
putln
(
"if (unlikely(!%s)) {"
%
Naming
.
cur_scope_cname
)
code
.
putln
(
"if (unlikely(!%s)) {"
%
Naming
.
cur_scope_cname
)
if
is_getbuffer_slot
:
# Scope unconditionally DECREFed on return.
self
.
getbuffer_error_cleanup
(
code
)
code
.
putln
(
"%s = %s;"
%
(
Naming
.
cur_scope_cname
,
if
use_refnanny
:
lenv
.
scope_class
.
type
.
cast_code
(
"Py_None"
)));
code
.
put_finish_refcount_context
()
code
.
put_incref
(
"Py_None"
,
py_object_type
);
if
acquire_gil
or
acquire_gil_for_var_decls_only
:
code
.
putln
(
code
.
error_goto
(
self
.
pos
))
code
.
put_release_ensured_gil
()
code
.
putln
(
"} else {"
)
# FIXME: what if the error return value is a Python value?
err_val
=
self
.
error_value
()
if
err_val
is
None
:
if
not
self
.
caller_will_check_exceptions
():
warning
(
self
.
entry
.
pos
,
"Unraisable exception in function '%s'."
%
self
.
entry
.
qualified_name
,
0
)
code
.
put_unraisable
(
self
.
entry
.
qualified_name
,
lenv
.
nogil
)
#if self.return_type.is_void:
code
.
putln
(
"return;"
)
else
:
code
.
putln
(
"return %s;"
%
err_val
)
code
.
putln
(
"}"
)
code
.
put_gotref
(
Naming
.
cur_scope_cname
)
code
.
put_gotref
(
Naming
.
cur_scope_cname
)
code
.
putln
(
"}"
)
# Note that it is unsafe to decref the scope at this point.
# Note that it is unsafe to decref the scope at this point.
if
self
.
needs_outer_scope
:
if
self
.
needs_outer_scope
:
if
self
.
is_cyfunction
:
if
self
.
is_cyfunction
:
...
...
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