summaryrefslogtreecommitdiffstats
path: root/Modules/_asynciomodule.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-32528: Make asyncio.CancelledError a BaseException. (GH-13528)Yury Selivanov2019-05-271-7/+4
| | | | | | | | | | | | | | | This will address the common mistake many asyncio users make: an "except Exception" clause breaking Tasks cancellation. In addition to this change, we stop inheriting asyncio.TimeoutError and asyncio.InvalidStateError from their concurrent.futures.* counterparts. There's no point for these exceptions to share the inheritance chain. In 3.9 we'll focus on implementing supervisors and cancel scopes, which should allow better handling of all exceptions, including SystemExit and KeyboardInterrupt
* asyncio: PendingDeprecationWarning -> DeprecationWarning (GH-12494)Inada Naoki2019-03-221-2/+2
| | | `Task.current_task()` and `Task.all_tasks()` will be removed in 3.9.
* bpo-35504: Fix segfaults and SystemErrors when deleting certain attrs. ↵Zackery Spytz2018-12-171-0/+12
| | | | (GH-11175)
* bpo-33029: Fix signatures of getter and setter functions. (GH-10746)Serhiy Storchaka2018-11-271-16/+16
| | | Fix also return type for few other functions (clear, releasebuffer).
* Fix a compiler warning added in bpo-34872. (GH-9722)Serhiy Storchaka2018-10-051-1/+1
|
* bpo-34872: Fix self-cancellation in C implementation of asyncio.Task (GH-9679)Elvis Pranskevichus2018-10-031-3/+8
| | | | | | | | | | | | | | | | | The C implementation of asyncio.Task currently fails to perform the cancellation cleanup correctly in the following scenario. async def task1(): async def task2(): await task3 # task3 is never cancelled asyncio.current_task().cancel() await asyncio.create_task(task2()) The actuall error is a hardcoded call to `future_cancel()` instead of calling the `cancel()` method of a future-like object. Thanks to Vladimir Matveev for noticing the code discrepancy and to Yury Selivanov for coming up with a pathological scenario.
* bpo-34762: Update PyContext* to PyObject* in asyncio and decimal (GH-9609)Yury Selivanov2018-09-271-9/+8
| | | This fixes various compiler warnings.
* bpo-34755: Add few minor optimizations in _asynciomodule.c. (GH-9455)Serhiy Storchaka2018-09-211-158/+116
|
* bpo-34622: Extract asyncio exceptions into a separate module (GH-9141)Andrew Svetlov2018-09-111-0/+2
|
* Fixed inconsistency in string handling in the Task C implementation (GH-8717)Alex Grönholm2018-08-091-5/+9
|
* bpo-34270: Make it possible to name asyncio tasks (GH-8547)Alex Grönholm2018-08-081-2/+58
| | | Co-authored-by: Antti Haapala <antti.haapala@anttipatterns.com>
* Make TaskStepMethWrapper_Type and TaskWakeupMethWrapper_Type static. (GH-8127)Benjamin Peterson2018-07-061-2/+2
|
* bpo-32610: Fix asyncio.all_tasks() to return only pending tasks. (GH-7174)Yury Selivanov2018-05-281-2/+2
|
* bpo-33623: Fix possible SIGSGV when asyncio.Future is created in __del__ (#7080)Yury Selivanov2018-05-281-1/+7
|
* bpo-33584: Fix several minor bugs in asyncio. (GH-7003)Serhiy Storchaka2018-05-201-15/+21
| | | | | | | | | | | | Fix the following bugs in the C implementation: * get_future_loop() silenced all exceptions raised when look up the get_loop attribute, not just an AttributeError. * enter_task() silenced all exceptions raised when look up the current task, not just a KeyError. * repr() was called for a borrowed link in enter_task() and task_step_impl(). * str() was used instead of repr() in formatting one error message (in Python implementation too). * There where few reference leaks in error cases.
* bpo-31787: Prevent refleaks when calling __init__() more than once (GH-3995)Oren Milman2018-02-131-9/+19
|
* bpo-32746: Fix multiple typos (GH-5144)Leo Arias2018-02-041-1/+1
| | | Fix typos found by codespell in docs, docstrings, and comments.
* bpo-32643: Drop support for a few private Task and Future APIs. (#5293)Yury Selivanov2018-01-241-106/+9
| | | | | | | | Specifically, it's not possible to subclass Task/Future classes and override the following methods: * Future._schedule_callbacks * Task._step * Task._wakeup
* bpo-32296: Make get_running_loop() another 4-5x faster (#5277)Yury Selivanov2018-01-231-62/+102
|
* bpo-32436: Implement PEP 567 (#5027)Yury Selivanov2018-01-231-55/+154
|
* Fix typo (#5049)Andrew Svetlov2017-12-301-1/+1
|
* bpo-31721: Allow Future._log_traceback to only be set to False (#5009)Yury Selivanov2017-12-251-0/+5
|
* bpo-32363: Disable Task.set_exception() and Task.set_result() (#4923)Yury Selivanov2017-12-251-9/+42
|
* bpo-32415: Fix "error is already set" (#4999)Yury Selivanov2017-12-231-0/+1
|
* bpo-32357: Use PySet_GET_SIZE macro in _is_coroutine() from _asynciomodule.c ↵Andrew Svetlov2017-12-231-1/+1
| | | | (#4990)
* bpo-32415: Add asyncio.Task.get_loop() and Future.get_loop() (#4992)Yury Selivanov2017-12-231-29/+69
|
* Fix GCC warning in _asynciomodule.c (#4928)Zackery Spytz2017-12-191-1/+1
|
* bpo-32357: Optimize asyncio.iscoroutine() for non-native coroutines (#4915)Yury Selivanov2017-12-191-28/+85
|
* bpo-32348: Optimize asyncio.Future schedule/add/remove callback. (#4907)Yury Selivanov2017-12-181-75/+322
|
* bpo-32250: Implement asyncio.current_task() and asyncio.all_tasks() (#4799)Andrew Svetlov2017-12-161-110/+260
|
* bpo-32311: Implement asyncio.create_task() shortcut (#4848)Andrew Svetlov2017-12-151-1/+28
| | | | | * Implement functionality * Add documentation
* bpo-32296: Implement asyncio.get_event_loop and _get_running_loop in C. (#4827)Yury Selivanov2017-12-131-7/+244
| | | | | | | | asyncio.get_event_loop(), and, subsequently asyncio._get_running_loop() are one of the most frequently executed functions in asyncio. They also can't be sped up by third-party event loops like uvloop. When implemented in C they become 4x faster.
* bpo-31185: Fixed miscellaneous errors in asyncio speedup module. (#3076)Serhiy Storchaka2017-09-031-207/+206
|
* bpo-31061: fix crash in asyncio speedup module (GH-2966)Alexander Mohr2017-08-021-0/+4
|
* bpo-30828: Fix out of bounds write in ↵Yury Selivanov2017-07-051-3/+10
| | | | `asyncio.CFuture.remove_done_callback() (#2569)
* bpo-30508: Don't log exceptions if Task/Future "cancel()" method called (#2050)Yury Selivanov2017-06-111-1/+17
|
* bpo-30048: asyncio: fix Task.cancel() was ignored. (GH-1097)INADA Naoki2017-05-111-0/+12
| | | | | | | | | | | | when there are no more `await` or `yield (from)` before return in coroutine, cancel was ignored. example: async def coro(): asyncio.Task.current_task().cancel() return 42 ... res = await coro() # should raise CancelledError
* bpo-28963: Fix out of bound iteration in ↵Yury Selivanov2017-03-031-1/+1
| | | | asyncio.Future.remove_done_callback/C (#408)
* bpo-29271: Fix Task.current_task and Task.all_tasks to accept None. (#406)Yury Selivanov2017-03-031-6/+6
|
* Use _PyObject_CallMethodIdObjArgs() in _asyncioVictor Stinner2016-12-091-17/+19
| | | | | | | | | Issue #28915: Replace _PyObject_CallMethodId() with _PyObject_CallMethodIdObjArgs() when the format string was only made of "O" formats, PyObject* arguments. _PyObject_CallMethodIdObjArgs() avoids the creation of a temporary tuple and doesn't have to parse a format string.
* Use _PyObject_CallNoArg()Victor Stinner2016-12-061-1/+1
| | | | | | | Replace: PyObject_CallFunctionObjArgs(callable, NULL) with: _PyObject_CallNoArg(callable)
* Use _PyObject_CallNoArg()Victor Stinner2016-12-061-6/+6
| | | | | | | Replace: PyObject_CallObject(callable, NULL) with: _PyObject_CallNoArg(callable)
* Issue #28858: Remove _PyObject_CallArg1() macroVictor Stinner2016-12-051-3/+3
| | | | | | | | | | | Replace _PyObject_CallArg1(func, arg) with PyObject_CallFunctionObjArgs(func, arg, NULL) Using the _PyObject_CallArg1() macro increases the usage of the C stack, which was unexpected and unwanted. PyObject_CallFunctionObjArgs() doesn't have this issue.
* Backed out changeset b9c9691c72c5Victor Stinner2016-12-041-5/+7
| | | | | | Issue #28858: The change b9c9691c72c5 introduced a regression. It seems like _PyObject_CallArg1() uses more stack memory than PyObject_CallFunctionObjArgs().
* Merge 3.6 (issue #28843)Yury Selivanov2016-12-011-0/+5
|
* Replace PyObject_CallFunctionObjArgs() with fastcallVictor Stinner2016-12-011-7/+5
| | | | | | | | | | | | | | * PyObject_CallFunctionObjArgs(func, NULL) => _PyObject_CallNoArg(func) * PyObject_CallFunctionObjArgs(func, arg, NULL) => _PyObject_CallArg1(func, arg) PyObject_CallFunctionObjArgs() allocates 40 bytes on the C stack and requires extra work to "parse" C arguments to build a C array of PyObject*. _PyObject_CallNoArg() and _PyObject_CallArg1() are simpler and don't allocate memory on the C stack. This change is part of the fastcall project. The change on listsort() is related to the issue #23507.
* correctly emulate error semantics of gen.throw in FutureIter_throwBenjamin Peterson2016-11-141-19/+34
|
* Issue #26081: Fix refleak in _asyncio.Future.__iter__().throw.Yury Selivanov2016-11-091-1/+3
|
* Issue #23996: Added _PyGen_SetStopIterationValue for safe raisingSerhiy Storchaka2016-11-061-18/+4
| | | | | StopIteration with value. More safely handle non-normalized exceptions in -_PyGen_FetchStopIterationValue.
* Issue #28544: Fix inefficient call to _PyObject_CallMethodId()Victor Stinner2016-10-291-1/+1
| | | | | "()" format string creates an empty list of argument but requires extra work to parse the format string.