| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d65c949 commit 8778c6b
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -57,9 +57,9 @@ asyncio currently provides two implementations of event loops: | |||
| 57 | 57 | ||
| 58 | 58 | Example to use a :class:`ProactorEventLoop` on Windows:: | |
| 59 | 59 | ||
| 60 | - import asyncio, os | ||
| 60 | + import asyncio, sys | ||
| 61 | 61 | ||
| 62 | - if os.name == 'nt': | ||
| 62 | + if sys.platform == 'win32': | ||
| 63 | 63 | loop = asyncio.ProactorEventLoop() | |
| 64 | 64 | asyncio.set_event_loop(loop) | |
| 65 | 65 | ||
@@ -196,4 +196,3 @@ Access to the global loop policy | |||
| 196 | 196 | ||
| 197 | 197 | Set the current event loop policy. If *policy* is ``None``, the default | |
| 198 | 198 | policy is restored. | |
| 199 | - | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,9 +12,9 @@ On Windows, the default event loop is :class:`SelectorEventLoop` which does not | |||
| 12 | 12 | support subprocesses. :class:`ProactorEventLoop` should be used instead. | |
| 13 | 13 | Example to use it on Windows:: | |
| 14 | 14 | ||
| 15 | - import asyncio, os | ||
| 15 | + import asyncio, sys | ||
| 16 | 16 | ||
| 17 | - if os.name == 'nt': | ||
| 17 | + if sys.platform == 'win32': | ||
| 18 | 18 | loop = asyncio.ProactorEventLoop() | |
| 19 | 19 | asyncio.set_event_loop(loop) | |
| 20 | 20 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments