diff -uNrp a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py
--- a/Lib/test/test_codecs.py	2019-12-21 15:08:05.068000000 +0800
+++ b/Lib/test/test_codecs.py	2019-12-21 15:17:35.536000000 +0800
@@ -1427,7 +1427,7 @@ class CodecsModuleTest(unittest.TestCase
     def test_lookup_issue1813(self):
         # Issue #1813: under Turkish locales, lookup of some codecs failed
         # because 'I' is lowercased as a dotless "i"
-        oldlocale = locale.getlocale(locale.LC_CTYPE)
+        oldlocale = locale.setlocale(locale.LC_CTYPE)
         self.addCleanup(locale.setlocale, locale.LC_CTYPE, oldlocale)
         try:
             locale.setlocale(locale.LC_CTYPE, 'tr_TR')
diff -uNrp a/Lib/test/test_locale.py b/Lib/test/test_locale.py
--- a/Lib/test/test_locale.py	2019-12-21 15:08:05.060000000 +0800
+++ b/Lib/test/test_locale.py	2019-12-21 15:19:01.140000000 +0800
@@ -469,7 +469,7 @@ class TestMiscellaneous(unittest.TestCas
 
     def test_getsetlocale_issue1813(self):
         # Issue #1813: setting and getting the locale under a Turkish locale
-        oldlocale = locale.getlocale()
+        oldlocale = locale.setlocale(locale.LC_CTYPE)
         self.addCleanup(locale.setlocale, locale.LC_CTYPE, oldlocale)
         for loc in ('tr_TR', 'tr_TR.UTF-8', 'tr_TR.ISO8859-9'):
             try:
@@ -494,7 +494,7 @@ class TestMiscellaneous(unittest.TestCas
         self.assertEqual(locale.normalize(u'en_US'), 'en_US.ISO8859-1')
 
     def test_setlocale_unicode(self):
-        oldlocale = locale.getlocale()
+        oldlocale = locale.setlocale(locale.LC_CTYPE)
         self.addCleanup(locale.setlocale, locale.LC_CTYPE, oldlocale)
 
         user_locale = locale.setlocale(locale.LC_CTYPE, '')
