1. Pypy
  2. Untitled project
  3. pypy


Armin Rigo  committed 031a4c9

(iko, rguillebert, arigo)

Don't use locale.resetlocale(), which explodes if invalid strings
are set in some environment variables.

  • Participants
  • Parent commits bca4299
  • Branches default

Comments (0)

Files changed (1)

File pypy/module/_sre/test/test_app_sre.py

View file
  • Ignore whitespace
                 + [s.OPCODES["at"], s.ATCODES["at_loc_non_boundary"], s.OPCODES["success"]]
             s.assert_match(opcodes1, "bla\xFC")
             s.assert_no_match(opcodes2, "bla\xFC")
+            oldlocale = locale.setlocale(locale.LC_ALL)
             locale.setlocale(locale.LC_ALL, "de_DE")
             s.assert_no_match(opcodes1, "bla\xFC")
             s.assert_match(opcodes2, "bla\xFC")
-            locale.resetlocale() # is this the right way to rest the locale?
+            locale.setlocale(locale.LC_ALL, oldlocale)
         except locale.Error:
             # skip test
             skip("locale error")