Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Kirill Smelkov
cpython
Commits
0296a565
Commit
0296a565
authored
Jan 13, 2012
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NULL and no exception set from tp_iternext means StopIteration
parent
9a80fa81
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
Lib/test/test_pep380.py
Lib/test/test_pep380.py
+5
-0
Python/ceval.c
Python/ceval.c
+2
-1
No files found.
Lib/test/test_pep380.py
View file @
0296a565
...
...
@@ -831,6 +831,11 @@ class TestPEP380Operation(unittest.TestCase):
"Enter f"
,
])
def
test_yield_from_empty
(
self
):
def
g
():
yield
from
()
self
.
assertRaises
(
StopIteration
,
next
,
g
())
def
test_main
():
from
test
import
support
...
...
Python/ceval.c
View file @
0296a565
...
...
@@ -1839,7 +1839,8 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
if
(
!
retval
)
{
/* iter may be exhausted */
Py_CLEAR
(
x
);
if
(
!
PyErr_ExceptionMatches
(
PyExc_StopIteration
))
{
if
(
PyErr_Occurred
()
&&
!
PyErr_ExceptionMatches
(
PyExc_StopIteration
))
{
/* some other exception */
break
;
}
...
...
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