mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	Read unidata_version from unicodedata module.
Delete old NormalizationTest.txt if it doesn't match unidata_version.
This commit is contained in:
		
							parent
							
								
									6d5ec2474d
								
							
						
					
					
						commit
						4dd3a50ca4
					
				
					 1 changed files with 9 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -3,10 +3,17 @@
 | 
			
		|||
 | 
			
		||||
import sys
 | 
			
		||||
import os
 | 
			
		||||
from unicodedata import normalize
 | 
			
		||||
from unicodedata import normalize, unidata_version
 | 
			
		||||
 | 
			
		||||
TESTDATAFILE = "NormalizationTest" + os.extsep + "txt"
 | 
			
		||||
TESTDATAURL = "http://www.unicode.org/Public/5.1.0/ucd/" + TESTDATAFILE
 | 
			
		||||
TESTDATAURL = "http://www.unicode.org/Public/" + unidata_version + "/ucd/" + TESTDATAFILE
 | 
			
		||||
 | 
			
		||||
if os.path.exists(TESTDATAFILE):
 | 
			
		||||
    f = open(TESTDATAFILE)
 | 
			
		||||
    l = f.readline()
 | 
			
		||||
    f.close()
 | 
			
		||||
    if not unidata_version in l:
 | 
			
		||||
        os.unlink(TESTDATAFILE)
 | 
			
		||||
 | 
			
		||||
class RangeError(Exception):
 | 
			
		||||
    pass
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue