1 Star 0 Fork 20

zhangy1317/python-testtools

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
testtools-2.4.0-fix-py3-compat.patch 1.28 KB
一键复制 编辑 原始数据 按行查看 历史
diff -urN testtools-2.4.0/testtools/_compat2x.py testtools-2.4.0-new/testtools/_compat2x.py
--- testtools-2.4.0/testtools/_compat2x.py 2015-11-08 01:27:33.000000000 +0800
+++ testtools-2.4.0-new/testtools/_compat2x.py 1970-01-01 08:00:00.000000000 +0800
@@ -1,17 +0,0 @@
-# Copyright (c) 2011 testtools developers. See LICENSE for details.
-
-"""Compatibility helpers that are valid syntax in Python 2.x.
-
-Only add things here if they *only* work in Python 2.x or are Python 2
-alternatives to things that *only* work in Python 3.x.
-"""
-
-__all__ = [
- 'reraise',
- ]
-
-
-def reraise(exc_class, exc_obj, exc_tb, _marker=object()):
- """Re-raise an exception received from sys.exc_info() or similar."""
- raise exc_class, exc_obj, exc_tb
-
diff -urN testtools-2.4.0/testtools/compat.py testtools-2.4.0-new/testtools/compat.py
--- testtools-2.4.0/testtools/compat.py 2018-04-05 07:27:14.000000000 +0800
+++ testtools-2.4.0-new/testtools/compat.py 2021-08-06 10:55:13.294527126 +0800
@@ -33,10 +33,7 @@
# To let setup.py work, make this a conditional import.
linecache = try_import('linecache2')
-try:
- from testtools import _compat2x as _compat
-except SyntaxError:
- from testtools import _compat3x as _compat
+from testtools import _compat3x as _compat
reraise = _compat.reraise
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangy1317/python-testtools.git
git@gitee.com:zhangy1317/python-testtools.git
zhangy1317
python-testtools
python-testtools
master

搜索帮助