Commits

Armin Rigo committed f24dbbb

Skip this test if sys.setdefaultencoding() was already removed,
e.g. when running with -A.

Comments (0)

Files changed (1)

pypy/objspace/std/test/test_stringobject.py

         # Need default encoding utf-8, but sys.setdefaultencoding
         # is removed after startup.
         import sys
+        if not hasattr(sys, 'setdefaultencoding'):
+            skip("sys.setdefaultencoding() not available")
         old_encoding = sys.getdefaultencoding()
         # Duplicate unittest.test_support.CleanImport logic because it won't
         # import.