@@ -569,12 +569,20 @@ def test_date_locale2(self):
569
569
'ti_ET' , 'tig_ER' , 'wal_ET' )
570
570
def test_time_locale (self ):
571
571
# Test %X directive
572
+ loc = locale .getlocale (locale .LC_TIME )[0 ]
573
+ pos = slice (3 , 6 )
574
+ if glibc_ver and glibc_ver < (2 , 29 ) and loc in {
575
+ 'aa_ET' , 'am_ET' , 'byn_ER' , 'gez_ET' , 'om_ET' ,
576
+ 'sid_ET' , 'so_SO' , 'ti_ET' , 'tig_ER' , 'wal_ET' }:
577
+ # Hours are in 12-hour notation without AM/PM indication.
578
+ # Ignore hours.
579
+ pos = slice (4 , 6 )
572
580
now = time .time ()
573
- self .roundtrip ('%X' , slice ( 3 , 6 ) , time .localtime (now ))
581
+ self .roundtrip ('%X' , pos , time .localtime (now ))
574
582
# 1 hour 20 minutes 30 seconds ago
575
- self .roundtrip ('%X' , slice ( 3 , 6 ) , time .localtime (now - 4830 ))
583
+ self .roundtrip ('%X' , pos , time .localtime (now - 4830 ))
576
584
# 12 hours ago
577
- self .roundtrip ('%X' , slice ( 3 , 6 ) , time .localtime (now - 12 * 3600 ))
585
+ self .roundtrip ('%X' , pos , time .localtime (now - 12 * 3600 ))
578
586
579
587
def test_percent (self ):
580
588
# Make sure % signs are handled properly
0 commit comments