bpo-32139: test_strftime does not anymore modify the locale (GH-4569) (#4635)
(cherry picked from commit cc55e78aca
)
This commit is contained in:
parent
957aef7c41
commit
b0df786258
|
@ -58,8 +58,10 @@ class StrftimeTest(unittest.TestCase):
|
||||||
import java
|
import java
|
||||||
java.util.Locale.setDefault(java.util.Locale.US)
|
java.util.Locale.setDefault(java.util.Locale.US)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
import locale
|
from locale import setlocale, LC_TIME
|
||||||
locale.setlocale(locale.LC_TIME, 'C')
|
saved_locale = setlocale(LC_TIME)
|
||||||
|
setlocale(LC_TIME, 'C')
|
||||||
|
self.addCleanup(setlocale, LC_TIME, saved_locale)
|
||||||
|
|
||||||
def test_strftime(self):
|
def test_strftime(self):
|
||||||
now = time.time()
|
now = time.time()
|
||||||
|
|
Loading…
Reference in New Issue