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
719ccbca
Commit
719ccbca
authored
Dec 23, 2017
by
Yury Selivanov
Committed by
GitHub
Dec 23, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-32415: Fix "error is already set" (#4999)
parent
a330f483
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
Lib/test/test_asyncio/test_tasks.py
Lib/test/test_asyncio/test_tasks.py
+26
-0
Modules/_asynciomodule.c
Modules/_asynciomodule.c
+1
-0
No files found.
Lib/test/test_asyncio/test_tasks.py
View file @
719ccbca
...
...
@@ -2302,6 +2302,32 @@ class PyTask_PyFuture_SubclassTests(BaseTaskTests, test_utils.TestCase):
pass
@
unittest
.
skipUnless
(
hasattr
(
tasks
,
'_CTask'
),
'requires the C _asyncio module'
)
class
CTask_Future_Tests
(
test_utils
.
TestCase
):
def
test_foobar
(
self
):
class
Fut
(
asyncio
.
Future
):
@
property
def
get_loop
(
self
):
raise
AttributeError
async
def
coro
():
await
fut
return
'spam'
self
.
loop
=
asyncio
.
new_event_loop
()
try
:
fut
=
Fut
(
loop
=
self
.
loop
)
self
.
loop
.
call_later
(
0.1
,
fut
.
set_result
(
1
))
task
=
asyncio
.
Task
(
coro
(),
loop
=
self
.
loop
)
res
=
self
.
loop
.
run_until_complete
(
task
)
finally
:
self
.
loop
.
close
()
self
.
assertEqual
(
res
,
'spam'
)
class
BaseTaskIntrospectionTests
:
_register_task
=
None
_unregister_task
=
None
...
...
Modules/_asynciomodule.c
View file @
719ccbca
...
...
@@ -203,6 +203,7 @@ get_future_loop(PyObject *fut)
return
res
;
}
PyErr_Clear
();
return
_PyObject_GetAttrId
(
fut
,
&
PyId__loop
);
}
...
...
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