1 Star 0 Fork 13

吴磊磊/python-mitmproxy

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0002-fix-asyncio_utils-run-in-python3.7.patch 1.70 KB
一键复制 编辑 原始数据 按行查看 历史
mdche 提交于 2021-10-15 09:52 . fix asyncio utils run in python3.7
From 1f3587e008dc7314a81db4cf998ea14f48d407ec Mon Sep 17 00:00:00 2001
From: gitee-cmd <chemingdao@huawei.com>
Date: Fri, 15 Oct 2021 10:07:57 +0800
Subject: [PATCH] fix asyncio_utils run in python3.7
---
mitmproxy/utils/asyncio_utils.py | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/mitmproxy/utils/asyncio_utils.py b/mitmproxy/utils/asyncio_utils.py
index 2feaaae..71972ab 100644
--- a/mitmproxy/utils/asyncio_utils.py
+++ b/mitmproxy/utils/asyncio_utils.py
@@ -29,37 +29,34 @@ def create_task(
Ideally we stop closing the event loop during shutdown and then remove this parameter.
"""
try:
- t = asyncio.create_task(coro, name=name)
+ t = asyncio.create_task(coro)
except RuntimeError:
if ignore_closed_loop:
coro.close()
return None
else:
raise
- set_task_debug_info(t, name=name, client=client)
+ set_task_debug_info(t, client=client)
return t
def set_task_debug_info(
task: asyncio.Task,
*,
- name: str,
client: Optional[tuple] = None,
) -> None:
"""Set debug info for an externally-spawned task."""
task.created = time.time() # type: ignore
- task.set_name(name)
if client:
task.client = client # type: ignore
def task_repr(task: asyncio.Task) -> str:
"""Get a task representation with debug info."""
- name = task.get_name()
age = getattr(task, "created", "")
if age:
age = f" (age: {time.time() - age:.0f}s)"
client = getattr(task, "client", "")
if client:
client = f"{human.format_address(client)}: "
- return f"{client}{name}{age}"
+ return f"{client}{age}"
--
2.30.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wu-leilei/python-mitmproxy.git
git@gitee.com:wu-leilei/python-mitmproxy.git
wu-leilei
python-mitmproxy
python-mitmproxy
master

搜索帮助