bpo-32139: test_strftime does not anymore modify the locale (GH-4569)
![](https://secure.gravatar.com/avatar/cc7737cd64a84f1b5c61a160798e97ee.jpg?s=120&d=mm&r=g)
https://github.com/python/cpython/commit/cc55e78acab93a495c974b9a2ea71c8bb9c... commit: cc55e78acab93a495c974b9a2ea71c8bb9cc2f5d branch: master author: xdegaye <xdegaye@gmail.com> committer: GitHub <noreply@github.com> date: 2017-11-29T11:36:48+01:00 summary: bpo-32139: test_strftime does not anymore modify the locale (GH-4569) files: M Lib/test/test_strftime.py diff --git a/Lib/test/test_strftime.py b/Lib/test/test_strftime.py index 72b1910c383..ec305e54ff2 100644 --- a/Lib/test/test_strftime.py +++ b/Lib/test/test_strftime.py @@ -58,8 +58,10 @@ def setUp(self): import java java.util.Locale.setDefault(java.util.Locale.US) except ImportError: - import locale - locale.setlocale(locale.LC_TIME, 'C') + from locale import setlocale, LC_TIME + saved_locale = setlocale(LC_TIME) + setlocale(LC_TIME, 'C') + self.addCleanup(setlocale, LC_TIME, saved_locale) def test_strftime(self): now = time.time()
participants (1)
-
xdegaye