| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -71,8 +71,8 @@ the event loop. | |||
| 71 | 71 | ||
| 72 | 72 | .. seealso:: | |
| 73 | 73 | ||
| 74 | - See the :ref:`Synchronization primitives <asyncio-sync>` section to | ||
| 75 | - synchronize tasks. | ||
| 74 | + The :ref:`Synchronization primitives <asyncio-sync>` section describes ways | ||
| 75 | + to synchronize tasks. | ||
| 76 | 76 | ||
| 77 | 77 | ||
| 78 | 78 | .. _asyncio-handle-blocking: | |
@@ -112,8 +112,8 @@ Detect coroutine objects never scheduled | |||
| 112 | 112 | ---------------------------------------- | |
| 113 | 113 | ||
| 114 | 114 | When a coroutine function is called and its result is not passed to | |
| 115 | - :func:`async` or to the :meth:`BaseEventLoop.create_task` method: the execution | ||
| 116 | - of the coroutine objet will never be scheduled and it is probably a bug. | ||
| 115 | + :func:`async` or to the :meth:`BaseEventLoop.create_task` method, the execution | ||
| 116 | + of the coroutine object will never be scheduled which is probably a bug. | ||
| 117 | 117 | :ref:`Enable the debug mode of asyncio <asyncio-debug-mode>` to :ref:`log a | |
| 118 | 118 | warning <asyncio-logger>` to detect it. | |
| 119 | 119 | ||
@@ -147,7 +147,7 @@ Detect exceptions never consumed | |||
| 147 | 147 | ||
| 148 | 148 | Python usually calls :func:`sys.displayhook` on unhandled exceptions. If | |
| 149 | 149 | :meth:`Future.set_exception` is called, but the exception is never consumed, | |
| 150 | - :func:`sys.displayhook` is not called. Instead, a :ref:`a log is emitted | ||
| 150 | + :func:`sys.displayhook` is not called. Instead, :ref:`a log is emitted | ||
| 151 | 151 | <asyncio-logger>` when the future is deleted by the garbage collector, with the | |
| 152 | 152 | traceback where the exception was raised. | |
| 153 | 153 | ||
@@ -195,7 +195,7 @@ traceback where the task was created. Output in debug mode:: | |||
| 195 | 195 | raise Exception("not consumed") | |
| 196 | 196 | Exception: not consumed | |
| 197 | 197 | ||
| 198 | - There are different options to fix this issue. The first option is to chain to | ||
| 198 | + There are different options to fix this issue. The first option is to chain the | ||
| 199 | 199 | coroutine in another coroutine and use classic try/except:: | |
| 200 | 200 | ||
| 201 | 201 | @asyncio.coroutine | |
@@ -218,10 +218,12 @@ function:: | |||
| 218 | 218 | except Exception: | |
| 219 | 219 | print("exception consumed") | |
| 220 | 220 | ||
| 221 | - See also the :meth:`Future.exception` method. | ||
| 221 | + .. seealso:: | ||
| 222 | + | ||
| 223 | + The :meth:`Future.exception` method. | ||
| 222 | 224 | ||
| 223 | 225 | ||
| 224 | - Chain correctly coroutines | ||
| 226 | + Chain coroutines correctly | ||
| 225 | 227 | -------------------------- | |
| 226 | 228 | ||
| 227 | 229 | When a coroutine function calls other coroutine functions and tasks, they | |
| Back | FazBrowse Home | New Git URL |
0 commit comments