1 Star 0 Fork 97

王策/anaconda

forked from src-openEuler/anaconda 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
bugfix-Handle-exceptions-from-threads-without-new-instances.patch 1.35 KB
一键复制 编辑 原始数据 按行查看 历史
xuxiaolong 提交于 2021-04-02 10:25 . sync 49 fixbug from github
From 8ab916a0fe7b46b20c3a51828600b4f7f207717a Mon Sep 17 00:00:00 2001
From: Vladimir Slavik <vslavik@redhat.com>
Date: Tue, 18 Aug 2020 15:23:49 +0200
Subject: [PATCH] Handle exceptions from threads without new instances
It is not possible to instantiate some exceptions with just an instance as
the only argument, for example UnicodeError and descendants. However, these
days it is possible to raise directly with the provided instance, no need to
instantiate the class. The instance also has the traceback already set, so no
need to set it either.
The original apparently came to be so due to incrementally rewriting python2's
3-argument form of raise. See also previous commits affecting this line,
in chronological order: 07b7034, d16512e, a6085b8.
Resolves: rhbz#1835027
---
pyanaconda/threading.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/threading.py b/pyanaconda/threading.py
index e0ab80229..d2327cf39 100644
--- a/pyanaconda/threading.py
+++ b/pyanaconda/threading.py
@@ -168,7 +168,7 @@ class ThreadManager(object):
with self._errors_lock:
exc_info = self._errors.pop(name)
if exc_info:
- raise exc_info[0](exc_info[1]).with_traceback(exc_info[2])
+ raise exc_info[1]
def in_main_thread(self):
"""Return True if it is run in the main thread."""
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wangce1988/anaconda.git
git@gitee.com:wangce1988/anaconda.git
wangce1988
anaconda
anaconda
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385