Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
tornadoweb
Tornado
提交
70af3ca0
Tornado
项目概览
镜像
/
tornadoweb
/
Tornado
11 个月 前同步成功
通知
26
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Tornado
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
70af3ca0
编写于
3月 11, 2018
作者:
B
Ben Darnell
提交者:
GitHub
3月 11, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2305 from bdarnell/jessie-compatibility
asyncio: Support Python 3.4.2 for compatibility with Debian jessie
上级
0c85b990
26fcc8e4
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
13 addition
and
6 deletion
+13
-6
tornado/gen.py
tornado/gen.py
+6
-1
tornado/ioloop.py
tornado/ioloop.py
+1
-1
tornado/platform/asyncio.py
tornado/platform/asyncio.py
+5
-3
tornado/test/asyncio_test.py
tornado/test/asyncio_test.py
+1
-1
未找到文件。
tornado/gen.py
浏览文件 @
70af3ca0
...
...
@@ -1292,7 +1292,12 @@ except ImportError:
break
raise
Return
(
_r
)
else
:
_wrap_awaitable
=
asyncio
.
ensure_future
try
:
_wrap_awaitable
=
asyncio
.
ensure_future
except
AttributeError
:
# asyncio.ensure_future was introduced in Python 3.4.4, but
# Debian jessie still ships with 3.4.2 so try the old name.
_wrap_awaitable
=
getattr
(
asyncio
,
'async'
)
def
convert_yielded
(
yielded
):
...
...
tornado/ioloop.py
浏览文件 @
70af3ca0
...
...
@@ -281,7 +281,7 @@ class IOLoop(Configurable):
else
:
try
:
loop
=
asyncio
.
get_event_loop
()
except
RuntimeError
:
except
(
RuntimeError
,
AssertionError
)
:
if
not
instance
:
return
None
raise
...
...
tornado/platform/asyncio.py
浏览文件 @
70af3ca0
...
...
@@ -104,7 +104,7 @@ class BaseAsyncIOLoop(IOLoop):
def
start
(
self
):
try
:
old_loop
=
asyncio
.
get_event_loop
()
except
RuntimeError
:
except
(
RuntimeError
,
AssertionError
)
:
old_loop
=
None
try
:
self
.
_setup_logging
()
...
...
@@ -211,7 +211,7 @@ class AsyncIOLoop(BaseAsyncIOLoop):
if
not
self
.
is_current
:
try
:
self
.
old_asyncio
=
asyncio
.
get_event_loop
()
except
RuntimeError
:
except
(
RuntimeError
,
AssertionError
)
:
self
.
old_asyncio
=
None
self
.
is_current
=
True
asyncio
.
set_event_loop
(
self
.
asyncio_loop
)
...
...
@@ -270,7 +270,9 @@ class AnyThreadEventLoopPolicy(asyncio.DefaultEventLoopPolicy):
def
get_event_loop
(
self
):
try
:
return
super
().
get_event_loop
()
except
RuntimeError
:
except
(
RuntimeError
,
AssertionError
):
# This was an AssertionError in python 3.4.2 (which ships with debian jessie)
# and changed to a RuntimeError in 3.4.3.
# "There is no current event loop in thread %r"
loop
=
self
.
new_event_loop
()
self
.
set_event_loop
(
loop
)
...
...
tornado/test/asyncio_test.py
浏览文件 @
70af3ca0
...
...
@@ -150,7 +150,7 @@ class AnyThreadEventLoopPolicyTest(unittest.TestCase):
def
run_policy_test
(
self
,
accessor
,
expected_type
):
# With the default policy, non-main threads don't get an event
# loop.
self
.
assertRaises
(
RuntimeError
,
self
.
assertRaises
(
(
RuntimeError
,
AssertionError
)
,
self
.
executor
.
submit
(
accessor
).
result
)
# Set the policy and we can get a loop.
asyncio
.
set_event_loop_policy
(
AnyThreadEventLoopPolicy
())
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录