当前仓库属于关闭状态,部分功能使用受限,详情请查阅 仓库状态说明
25 Star 1 Fork 13

src-openEuler / python2
关闭

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
bugfix-excessive-memory-usage-when-using-regular-expressions.patch 866 Bytes
一键复制 编辑 原始数据 按行查看 历史
diff --git a/Lib/sre_compile.py b/Lib/sre_compile.py
index b6689fa..0063845 100644
--- a/Lib/sre_compile.py
+++ b/Lib/sre_compile.py
@@ -271,7 +271,7 @@ def _optimize_charset(charset, fixup, fixes, isunicode):
else:
charmap[av] = 1
elif op is RANGE:
- r = range(av[0], av[1]+1)
+ r = xrange(av[0], av[1]+1)
if fixup:
r = map(fixup, r)
if fixup and fixes:
@@ -374,7 +374,7 @@ def _optimize_charset(charset, fixup, fixes, isunicode):
mapping = bytearray(256)
block = 0
data = bytearray()
- for i in range(0, 65536, 256):
+ for i in xrange(0, 65536, 256):
chunk = charmap[i: i + 256]
if chunk in comps:
mapping[i // 256] = comps[chunk]
--
1.8.3.1
1
https://gitee.com/src-openeuler/python2.git
git@gitee.com:src-openeuler/python2.git
src-openeuler
python2
python2
master

搜索帮助