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

Skip to content

Commit bb417dc

Browse files
committed
Merged revisions 66369 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r66369 | martin.v.loewis | 2008-09-10 21:16:35 +0200 (Mi, 10 Sep 2008) | 4 lines Read unidata_version from unicodedata module. Delete old NormalizationTest.txt if it doesn't match unidata_version. ........
1 parent 6dfcb02 commit bb417dc

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

Lib/test/test_normalization.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,17 @@
33

44
import sys
55
import os
6-
from unicodedata import normalize
6+
from unicodedata import normalize, unidata_version
77

88
TESTDATAFILE = "NormalizationTest.txt"
9-
TESTDATAURL = "http://www.unicode.org/Public/5.1.0/ucd/" + TESTDATAFILE
9+
TESTDATAURL = "http://www.unicode.org/Public/" + unidata_version + "/ucd/" + TESTDATAFILE
10+
11+
if os.path.exists(TESTDATAFILE):
12+
f = open(TESTDATAFILE)
13+
l = f.readline()
14+
f.close()
15+
if not unidata_version in l:
16+
os.unlink(TESTDATAFILE)
1017

1118
class RangeError(Exception):
1219
pass

0 commit comments

Comments
 (0)