diff -r d0ed9643cd57 Lib/test/test_site.py --- a/Lib/test/test_site.py Thu Nov 17 23:31:29 2016 -0600 +++ b/Lib/test/test_site.py Fri Nov 18 11:20:56 2016 +0100 @@ -17,6 +17,7 @@ import shutil import subprocess import sysconfig +import _locale from copy import copy # These tests are not particularly useful if Python was invoked with -S. @@ -443,6 +444,10 @@ def test_startup_imports(self): # This tests checks which modules are loaded by Python when it # initially starts upon startup. + if (not sys.platform.startswith("win") and + not hasattr(_locale, 'CODESET')): + self.skipTest('does not have CODESET') + popen = subprocess.Popen([sys.executable, '-I', '-v', '-c', 'import sys; print(set(sys.modules))'], stdout=subprocess.PIPE,