Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1babdfc

Browse files
committed
Reduced memory burden by iterating over the normalization test input
file directly (instead of sucking it all into a list of lines first).
1 parent 1b445d3 commit 1babdfc

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

Lib/test/regrtest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ def printlist(x, width=70, indent=4):
506506
# test_normalization
507507
# Whether a skip is expected here depends on whether a large test
508508
# input file has been downloaded. test_normalization.skip_expected
509-
# controls that
509+
# controls that.
510510

511511
_expectations = {
512512
'win32':

Lib/test/test_normalization.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ def test_main():
3333
raise TestSkipped(TESTDATAFILE + " not found, download from " +
3434
"http://www.unicode.org/Public/UNIDATA/" + TESTDATAFILE)
3535

36-
data = open(TESTDATAFILE).readlines()
37-
3836
part1_data = {}
39-
for line in data:
37+
for line in open(TESTDATAFILE):
4038
if '#' in line:
4139
line = line.split('#')[0]
4240
line = line.strip()

0 commit comments

Comments
 (0)