|
5 | 5 | import locale |
6 | 6 | import re |
7 | 7 | import os |
| 8 | +import platform |
8 | 9 | import sys |
9 | 10 | from test import support |
10 | 11 | from test.support import warnings_helper |
|
13 | 14 |
|
14 | 15 | import _strptime |
15 | 16 |
|
| 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 | + |
16 | 24 | class getlang_Tests(unittest.TestCase): |
17 | 25 | """Test _getlang""" |
18 | 26 | def test_basic(self): |
@@ -482,9 +490,12 @@ def test_bad_timezone(self): |
482 | 490 | # for az_IR, fa_IR, lzh_TW, my_MM, or_IN, shn_MM. |
483 | 491 | @run_with_locales('LC_TIME', 'C', 'en_US', 'fr_FR', 'de_DE', 'ja_JP', |
484 | 492 | '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') |
486 | 494 | def test_date_time_locale(self): |
487 | 495 | # 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') |
488 | 499 | now = time.time() |
489 | 500 | self.roundtrip('%c', slice(0, 6), time.localtime(now)) |
490 | 501 | # 1 hour 20 minutes 30 seconds ago |
|
0 commit comments