Skip to content

Commit f64b374

Browse files
Fix testing br_FR on old glibc.
1 parent ef8c18e commit f64b374

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Lib/test/test_strptime.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import locale
66
import re
77
import os
8+
import platform
89
import sys
910
from test import support
1011
from test.support import warnings_helper
@@ -13,6 +14,13 @@
1314

1415
import _strptime
1516

17+
libc_ver = platform.libc_ver()
18+
if libc_ver[0] == 'glibc':
19+
glibc_ver = tuple(map(int, libc_ver[1].split('.')))
20+
else:
21+
glibc_ver = None
22+
23+
1624
class getlang_Tests(unittest.TestCase):
1725
"""Test _getlang"""
1826
def test_basic(self):
@@ -482,9 +490,12 @@ def test_bad_timezone(self):
482490
# for az_IR, fa_IR, lzh_TW, my_MM, or_IN, shn_MM.
483491
@run_with_locales('LC_TIME', 'C', 'en_US', 'fr_FR', 'de_DE', 'ja_JP',
484492
'he_IL', 'eu_ES', 'ar_AE', 'mfe_MU', 'yo_NG',
485-
'csb_PL', 'br_FR', 'gez_ET', 'brx_IN')
493+
'csb_PL', 'br_FR', 'gez_ET', 'brx_IN', 'id_ID')
486494
def test_date_time_locale(self):
487495
# Test %c directive
496+
loc = locale.getlocale(locale.LC_TIME)[0]
497+
if glibc_ver and glibc_ver < (2, 31) and loc == 'br_FR':
498+
self.skipTest('%c in locale br_FR does not include time')
488499
now = time.time()
489500
self.roundtrip('%c', slice(0, 6), time.localtime(now))
490501
# 1 hour 20 minutes 30 seconds ago

0 commit comments

Comments
 (0)