components/python/python35/patches/25-test_site.patch
author John Beck <John.Beck@Oracle.COM>
Tue, 29 Sep 2015 14:11:08 -0700
changeset 4912 0b79e9575718
child 6447 56a2f066191a
permissions -rw-r--r--
PSARC 2015/414 Python 3.5 21918688 Python 3.5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4912
0b79e9575718 PSARC 2015/414 Python 3.5
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     1
This patch came from in-house.  A patch to make -I imply -S was submitted
0b79e9575718 PSARC 2015/414 Python 3.5
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     2
upstream, but rejected, so this is the next simplest way to work around
0b79e9575718 PSARC 2015/414 Python 3.5
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     3
issues with when the site module is imported.
0b79e9575718 PSARC 2015/414 Python 3.5
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     4
0b79e9575718 PSARC 2015/414 Python 3.5
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     5
--- Python-3.5.0rc2/Lib/test/test_site.py.~1~	2015-08-25 10:19:13.000000000 -0700
0b79e9575718 PSARC 2015/414 Python 3.5
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     6
+++ Python-3.5.0rc2/Lib/test/test_site.py	2015-09-02 12:38:45.356337855 -0700
0b79e9575718 PSARC 2015/414 Python 3.5
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     7
@@ -438,7 +438,7 @@
0b79e9575718 PSARC 2015/414 Python 3.5
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     8
     def test_startup_imports(self):
0b79e9575718 PSARC 2015/414 Python 3.5
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     9
         # This tests checks which modules are loaded by Python when it
0b79e9575718 PSARC 2015/414 Python 3.5
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    10
         # initially starts upon startup.
0b79e9575718 PSARC 2015/414 Python 3.5
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    11
-        popen = subprocess.Popen([sys.executable, '-I', '-v', '-c',
0b79e9575718 PSARC 2015/414 Python 3.5
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    12
+        popen = subprocess.Popen([sys.executable, '-I', '-S', '-v', '-c',
0b79e9575718 PSARC 2015/414 Python 3.5
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    13
                                   'import sys; print(set(sys.modules))'],
0b79e9575718 PSARC 2015/414 Python 3.5
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    14
                                  stdout=subprocess.PIPE,
0b79e9575718 PSARC 2015/414 Python 3.5
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    15
                                  stderr=subprocess.PIPE)
0b79e9575718 PSARC 2015/414 Python 3.5
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    16
@@ -447,8 +447,6 @@
0b79e9575718 PSARC 2015/414 Python 3.5
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    17
         stderr = stderr.decode('utf-8')
0b79e9575718 PSARC 2015/414 Python 3.5
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    18
         modules = eval(stdout)
0b79e9575718 PSARC 2015/414 Python 3.5
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    19
 
0b79e9575718 PSARC 2015/414 Python 3.5
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    20
-        self.assertIn('site', modules)
0b79e9575718 PSARC 2015/414 Python 3.5
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    21
-
0b79e9575718 PSARC 2015/414 Python 3.5
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    22
         # http://bugs.python.org/issue19205
0b79e9575718 PSARC 2015/414 Python 3.5
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    23
         re_mods = {'re', '_sre', 'sre_compile', 'sre_constants', 'sre_parse'}
0b79e9575718 PSARC 2015/414 Python 3.5
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    24
         # _osx_support uses the re module in many placs