@@ -437,33 +437,26 @@ def generateCollTestDataObjects(self, filename, icu_version, ignorePunctuation,
437437 # It's a data line. Include in testing.
438438 if not prev :
439439 # Just getting started.
440- prev , prev_codepoints = self .parseCollTestData (item )
440+ prev = self .parseCollTestData (item )
441441 continue
442442
443443 # Get the code points for each test
444- try :
445- next , next_codepoints = self .parseCollTestData (item )
446- except BaseException as e :
447- pass
444+ next = self .parseCollTestData (item )
448445
449446 if not next :
450447 # This is a problem with the data input. D80[0-F] is the high surrogate
451448 data_errors .append ([index , item ])
452449 continue
453450
454451 label = str (count ).rjust (max_digits , "0" )
455- new_test = {"label" : label , "s1" : prev , "s2" : next , "strength" : "identical" , "line" : line_number ,
456- "source_file" : filename ,
457- "s1_codes" : prev_codepoints ,
458- "s2_codes" : next_codepoints }
452+ new_test = {"label" : label , "s1" : prev , "s2" : next , "strength" : "identical" , "line" : line_number , "source_file" : filename }
459453 if ignorePunctuation :
460454 new_test ["ignorePunctuation" ] = True
461455 test_list .append (new_test )
462456
463457 verify_list .append ({"label" : label , "verify" : True })
464458
465459 prev = next # set up for next pair
466- prev_codepoints = next_codepoints
467460 count += 1
468461 index += 1
469462
@@ -483,21 +476,16 @@ def parseCollTestData(self, testdata):
483476 recodepoint = re .compile (r"[0-9a-fA-F]{4,6}" )
484477
485478 return_list = []
486- code_text = []
487479 codepoints = recodepoint .findall (testdata )
488480 for code in codepoints :
489- code_text .append (code )
490481 num_code = int (code , 16 )
491482 if num_code >= 0xD800 and num_code <= 0xDFFF :
492- return None , None
483+ return None
493484 return_list .append (self .stringifyCode (num_code ))
494- return "" .join (return_list ), code_text
485+ return "" .join (return_list )
495486
496487 def stringifyCode (self , cp ):
497488 # Just include character and escaping will work in JSONification
498- if cp >= 0x10000 :
499- # This is an SMP character. Do we handle it differently?
500- pass
501489 try :
502490 teststring = chr (cp )
503491 except ValueError as err :
0 commit comments