Skip to content

Commit 9ff69e2

Browse files
committed
address comments
1 parent 80f3bed commit 9ff69e2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Lib/test/test_locale.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -499,18 +499,18 @@ def test_defaults_UTF8(self):
499499
else:
500500
orig_getlocale = None
501501

502-
with os_helper.EnvironmentVarGuard() as env:
503-
for key in ('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE'):
504-
env.unset(key)
502+
try:
503+
with os_helper.EnvironmentVarGuard() as env:
504+
for key in ('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE'):
505+
env.unset(key)
505506

506-
env['LC_CTYPE'] = 'UTF-8'
507+
env.set('LC_CTYPE', 'UTF-8')
507508

508-
try:
509509
with check_warnings(('', DeprecationWarning)):
510510
self.assertEqual(locale.getdefaultlocale(), (None, 'UTF-8'))
511-
finally:
512-
if orig_getlocale is not None:
513-
_locale._getdefaultlocale = orig_getlocale
511+
finally:
512+
if orig_getlocale is not None:
513+
_locale._getdefaultlocale = orig_getlocale
514514

515515
def test_getencoding(self):
516516
# Invoke getencoding to make sure it does not cause exceptions.

0 commit comments

Comments
 (0)