summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2017-11-29 15:18:22 (GMT)
committerxdegaye <xdegaye@gmail.com>2017-11-29 15:18:22 (GMT)
commitb0df786258c99f98295b82ec62daea1f49912c33 (patch)
treeaad475f417eded98d5d0a4fd8a343257e1786717 /Lib
parent957aef7c41ccae8a60d3dbbe8863401bd270dc86 (diff)
downloadcpython-b0df786258c99f98295b82ec62daea1f49912c33.zip
cpython-b0df786258c99f98295b82ec62daea1f49912c33.tar.gz
cpython-b0df786258c99f98295b82ec62daea1f49912c33.tar.bz2
bpo-32139: test_strftime does not anymore modify the locale (GH-4569) (#4635)
(cherry picked from commit cc55e78acab93a495c974b9a2ea71c8bb9cc2f5d)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_strftime.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_strftime.py b/Lib/test/test_strftime.py
index 72b1910..ec305e5 100644
--- a/Lib/test/test_strftime.py
+++ b/Lib/test/test_strftime.py
@@ -58,8 +58,10 @@ class StrftimeTest(unittest.TestCase):
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()