1. Mike Gilbert
  2. python-gentoo-patches

Commits

Mike Gilbert  committed fe4360f

Updates for 3.4.0

  • Participants
  • Parent commits c7b8764
  • Branches 3.4.0, 3.4.1 3
    1. 3.4.2
    2. 3.4.3
    3. 3.5.0
  • Tags 3.4.0-0

Comments (0)

Files changed (9)

File patches/01_all_static_library_location.patch

View file
  • Ignore whitespace
 
 --- Makefile.pre.in
 +++ Makefile.pre.in
-@@ -965,6 +965,19 @@
- 		fi; \
- 	else	true; \
+@@ -989,6 +989,19 @@
+ 		$(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \
+ 			$$ensurepip --root=$(DESTDIR)/ ; \
  	fi
 +	@if test -f $(LIBRARY) && test $(LIBRARY) != $(LDLIBRARY); then \
 +		if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
 +	else	true; \
 +	fi
  
- bininstall: altbininstall
- 	-if test -f $(DESTDIR)$(BINDIR)/python3$(EXE) -o -h $(DESTDIR)$(BINDIR)/python3$(EXE); \
-@@ -1200,18 +1213,6 @@
+ commoninstall:  @FRAMEWORKALTINSTALLFIRST@ \
+ 		altbininstall libinstall inclinstall libainstall \
+@@ -1309,18 +1322,6 @@
  		else	true; \
  		fi; \
  	done
  	$(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
 --- Misc/python-config.in
 +++ Misc/python-config.in
-@@ -47,11 +47,7 @@
+@@ -49,11 +49,7 @@
      elif opt in ('--libs', '--ldflags'):
          libs = getvar('LIBS').split() + getvar('SYSLIBS').split()
          libs.append('-lpython' + pyver + sys.abiflags)
              if not getvar('PYTHONFRAMEWORK'):
                  libs.extend(getvar('LINKFORSHARED').split())
          print(' '.join(libs))
+--- Misc/python-config.sh.in
++++ Misc/python-config.sh.in
+@@ -45,7 +45,6 @@
+ LDLIBRARY="@LDLIBRARY@"
+ LINKFORSHARED="@LINKFORSHARED@"
+ OPT="@OPT@"
+-PY_ENABLE_SHARED="@PY_ENABLE_SHARED@"
+ LDVERSION="@LDVERSION@"
+ LIBDEST=${prefix}/lib/python${VERSION}
+ LIBPL=$(echo "@LIBPL@" | sed "s#$prefix_build#$prefix_real#")
+@@ -92,11 +91,7 @@
+             if [ -z "$PYTHONFRAMEWORK" ] ; then
+                 LINKFORSHAREDUSED=$LINKFORSHARED
+             fi
+-            LIBPLUSED=
+-            if [ "$PY_ENABLE_SHARED" = "0" ] ; then
+-                LIBPLUSED="-L$LIBPL"
+-            fi
+-            echo "$LIBPLUSED -L$libdir $LIBS $LINKFORSHAREDUSED"
++            echo "-L$libdir $LIBS $LINKFORSHAREDUSED"
+         ;;
+         --extension-suffix)
+             echo "$SO"
 --- Modules/makesetup
 +++ Modules/makesetup
 @@ -89,7 +89,7 @@

File patches/02_all_disable_modules_and_ssl.patch

View file
  • Ignore whitespace
 --- setup.py
 +++ setup.py
-@@ -31,7 +31,17 @@
+@@ -33,7 +33,17 @@
  COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS"))
  
  # This global variable is used to hold the list of modules to be disabled.
  
  def add_dir_to_list(dirlist, dir):
      """Add the directory 'dir' to the list 'dirlist' (after any relative
-@@ -435,6 +445,7 @@
+@@ -441,6 +451,7 @@
              os.unlink(tmpfile)
  
      def detect_modules(self):
          # Ensure that /usr/local is always used, but the local build
          # directories (i.e. '.' and 'Include') must be first.  See issue
          # 10520.
-@@ -747,7 +758,7 @@
+@@ -757,7 +768,7 @@
          ssl_incs = find_file('openssl/ssl.h', inc_dirs,
                               search_for_ssl_incs_in
                               )
              krb5_h = find_file('krb5.h', inc_dirs,
                                 ['/usr/kerberos/include'])
              if krb5_h:
-@@ -758,7 +769,8 @@
+@@ -768,7 +779,8 @@
                                       ] )
  
          if (ssl_incs is not None and
              exts.append( Extension('_ssl', ['_ssl.c'],
                                     include_dirs = ssl_incs,
                                     library_dirs = ssl_libs,
-@@ -791,7 +803,7 @@
+@@ -801,7 +813,7 @@
  
          #print('openssl_ver = 0x%08x' % openssl_ver)
          min_openssl_ver = 0x00907000

File patches/03_all_libdir.patch

View file
  • Ignore whitespace
          'data'   : '$base',
 --- Lib/distutils/sysconfig.py
 +++ Lib/distutils/sysconfig.py
-@@ -144,7 +144,7 @@
+@@ -142,7 +142,7 @@
  
      if os.name == "posix":
          libpython = os.path.join(prefix,
          else:
 --- Lib/site.py
 +++ Lib/site.py
-@@ -303,10 +303,10 @@
-         if sys.platform in ('os2emx', 'riscos'):
-             sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
-         elif os.sep == '/':
+@@ -304,10 +304,10 @@
+         seen.add(prefix)
+ 
+         if os.sep == '/':
 -            sitepackages.append(os.path.join(prefix, "lib",
 +            sitepackages.append(os.path.join(prefix, "@@GENTOO_LIBDIR@@",
                                          "python" + sys.version[:3],
              sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
 --- Lib/sysconfig.py
 +++ Lib/sysconfig.py
-@@ -21,10 +21,10 @@
+@@ -20,10 +20,10 @@
  
  _INSTALL_SCHEMES = {
      'posix_prefix': {
          'include':
              '{installed_base}/include/python{py_version_short}{abiflags}',
          'platinclude':
-@@ -81,10 +81,10 @@
+@@ -61,10 +61,10 @@
          'data': '{userbase}',
          },
      'posix_user': {
          'data': '{userbase}',
 --- Lib/test/test_site.py
 +++ Lib/test/test_site.py
-@@ -248,10 +248,10 @@
+@@ -244,10 +244,10 @@
          elif os.sep == '/':
              # OS X non-framwework builds, Linux, FreeBSD, etc
              self.assertEqual(len(dirs), 2)
  # Detailed destination directories
 --- Modules/getpath.c
 +++ Modules/getpath.c
-@@ -122,8 +122,8 @@
+@@ -118,8 +118,8 @@
  #endif
  
  #ifndef PYTHONPATH
  #endif
  
  #ifndef LANDMARK
-@@ -135,7 +135,7 @@
- static wchar_t progpath[MAXPATHLEN+1];
- static wchar_t *module_search_path = NULL;
- static int module_search_path_malloced = 0;
--static wchar_t *lib_python = L"lib/python" VERSION;
-+static wchar_t *lib_python = L"@@GENTOO_LIBDIR@@/python" VERSION;
+@@ -494,7 +494,7 @@
+     _pythonpath = _Py_char2wchar(PYTHONPATH, NULL);
+     _prefix = _Py_char2wchar(PREFIX, NULL);
+     _exec_prefix = _Py_char2wchar(EXEC_PREFIX, NULL);
+-    lib_python = _Py_char2wchar("lib/python" VERSION, NULL);
++    lib_python = _Py_char2wchar("@@GENTOO_LIBDIR@@/python" VERSION, NULL);
  
- static void
- reduce(wchar_t *dir)
-@@ -685,7 +685,7 @@
+     if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) {
+         Py_FatalError(
+@@ -683,7 +683,7 @@
      }
      else
          wcsncpy(zip_path, _prefix, MAXPATHLEN);
  
 --- Modules/Setup.dist
 +++ Modules/Setup.dist
-@@ -354,7 +354,7 @@
+@@ -358,7 +358,7 @@
  # Andrew Kuchling's zlib module.
  # This require zlib 1.1.3 (or later).
  # See http://www.gzip.org/zlib/
  #
 --- setup.py
 +++ setup.py
-@@ -507,8 +507,7 @@
+@@ -513,8 +513,7 @@
          # be assumed that no additional -I,-L directives are needed.
          if not cross_compiling:
              lib_dirs = self.compiler.library_dirs + [
                  ]
              inc_dirs = self.compiler.include_dirs + ['/usr/include']
          else:
-@@ -723,11 +722,11 @@
+@@ -733,11 +732,11 @@
              elif curses_library:
                  readline_libs.append(curses_library)
              elif self.compiler.find_library_file(lib_dirs +

File patches/04_all_non-zero_exit_status_on_failure.patch

View file
  • Ignore whitespace
 
 --- setup.py
 +++ setup.py
-@@ -43,6 +43,8 @@
+@@ -45,6 +45,8 @@
  else:
      disable_ssl = 0
  
  def add_dir_to_list(dirlist, dir):
      """Add the directory 'dir' to the list 'dirlist' (after any relative
      directories) if:
-@@ -277,6 +279,8 @@
+@@ -280,6 +282,8 @@
              print()
  
          if self.failed:
              failed = self.failed[:]
              print()
              print("Failed to build these modules:")
-@@ -2213,6 +2217,7 @@
+@@ -2219,6 +2223,7 @@
            scripts = ["Tools/scripts/pydoc3", "Tools/scripts/idle3",
                       "Tools/scripts/2to3", "Tools/scripts/pyvenv"]
          )

File patches/05_all_regenerate_platform-specific_modules.patch

View file
  • Ignore whitespace
 +python$EXE ../../Tools/scripts/h2py.py /usr/include/sys/stropts.h
 --- Makefile.pre.in
 +++ Makefile.pre.in
-@@ -444,7 +444,7 @@
+@@ -459,7 +459,7 @@
  
  # Default target
  all:		build_all
--build_all:	$(BUILDPYTHON) oldsharedmods sharedmods gdbhooks Modules/_testembed
-+build_all:	$(BUILDPYTHON) oldsharedmods sharedmods platformspecificmods gdbhooks Modules/_testembed
+-build_all:	$(BUILDPYTHON) oldsharedmods sharedmods gdbhooks Modules/_testembed python-config
++build_all:	$(BUILDPYTHON) oldsharedmods sharedmods platformspecificmods gdbhooks Modules/_testembed python-config
  
  # Compile a binary with gcc profile guided optimization.
  profile-opt:
-@@ -500,6 +500,32 @@
+@@ -557,6 +557,32 @@
  		_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
  		$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
  
  # Build static library
  # avoid long command lines, same as LIBRARY_OBJS
  $(LIBRARY): $(LIBRARY_OBJS)
-@@ -1074,7 +1100,7 @@
+@@ -1174,7 +1200,7 @@
  		unittest unittest/test unittest/test/testmock \
  		venv venv/scripts venv/scripts/posix \
  		curses pydoc_data $(MACHDEPS)
  	@for i in $(SCRIPTDIR) $(LIBDEST); \
  	do \
  		if test ! -d $(DESTDIR)$$i; then \
-@@ -1157,23 +1183,6 @@
+@@ -1257,23 +1283,6 @@
  	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  		$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
  
 -	fi; \
 -	cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
 -
- python-config: $(srcdir)/Misc/python-config.in
+ python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh
  	# Substitution happens here, as the completely-expanded BINDIR
  	# is not available in configure
-@@ -1476,7 +1485,7 @@
+@@ -1595,7 +1604,7 @@
  Python/thread.o: @THREADHEADERS@
  
  # Declare targets that aren't real files

File patches/21_all_distutils_c++.patch

View file
  • Ignore whitespace
 
 --- Lib/distutils/cygwinccompiler.py
 +++ Lib/distutils/cygwinccompiler.py
-@@ -124,8 +124,10 @@
+@@ -125,8 +125,10 @@
          # dllwrap 2.10.90 is buggy
          if self.ld_version >= "2.10.90":
              self.linker_dll = "gcc"
  
          # ld_version >= "2.13" support -shared so use it instead of
          # -mdll -static
-@@ -139,9 +141,13 @@
+@@ -140,9 +142,13 @@
          self.set_executables(compiler='gcc -mcygwin -O -Wall',
                               compiler_so='gcc -mcygwin -mdll -O -Wall',
                               compiler_cxx='g++ -mcygwin -O -Wall',
  
          # cygwin and mingw32 need different sets of libraries
          if self.gcc_version == "2.91.57":
-@@ -165,8 +171,12 @@
+@@ -166,8 +172,12 @@
                  raise CompileError(msg)
          else: # for other files use the C-compiler
              try:
                  raise CompileError(msg)
  
 @@ -302,9 +312,14 @@
-         self.set_executables(compiler='gcc%s -O -Wall' % no_cygwin,
-                              compiler_so='gcc%s -mdll -O -Wall' % no_cygwin,
-                              compiler_cxx='g++%s -O -Wall' % no_cygwin,
-+                             compiler_so_cxx='g++%s -mdll -O -Wall' % no_cygwin,
-                              linker_exe='gcc%s' % no_cygwin,
-                              linker_so='%s%s %s %s'
-                                     % (self.linker_dll, no_cygwin,
-+                                       shared_option, entry_point),
-+                             linker_exe_cxx='g++%s' % no_cygwin,
-+                             linker_so_cxx='%s%s %s %s'
-+                                    % (self.linker_dll_cxx, no_cygwin,
-                                        shared_option, entry_point))
+         self.set_executables(compiler='gcc -O -Wall',
+                              compiler_so='gcc -mdll -O -Wall',
+                              compiler_cxx='g++ -O -Wall',
++                             compiler_so_cxx='g++ -mdll -O -Wall',
+                              linker_exe='gcc',
+                              linker_so='%s %s %s'
+                                         % (self.linker_dll, shared_option,
++                                           entry_point),
++                             linker_exe_cxx='g++',
++                             linker_so_cxx='%s %s %s'
++                                        % (self.linker_dll_cxx, shared_option,
+                                            entry_point))
          # Maybe we should also append -mthreads, but then the finished
          # dlls need another dll (mingwm10.dll see Mingw32 docs)
---- Lib/distutils/emxccompiler.py
-+++ Lib/distutils/emxccompiler.py
-@@ -63,8 +63,12 @@
-         # XXX optimization, warnings etc. should be customizable.
-         self.set_executables(compiler='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
-                              compiler_so='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
-+                             compiler_cxx='g++ -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
-+                             compiler_so_cxx='g++ -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall',
-                              linker_exe='gcc -Zomf -Zmt -Zcrtdll',
--                             linker_so='gcc -Zomf -Zmt -Zcrtdll -Zdll')
-+                             linker_so='gcc -Zomf -Zmt -Zcrtdll -Zdll',
-+                             linker_exe_cxx='g++ -Zomf -Zmt -Zcrtdll',
-+                             linker_so_cxx='g++ -Zomf -Zmt -Zcrtdll -Zdll')
- 
-         # want the gcc library statically linked (so that we don't have
-         # to distribute a version dependent on the compiler we have)
-@@ -81,8 +85,12 @@
-                 raise CompileError(msg)
-         else: # for other files use the C-compiler
-             try:
--                self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
--                           extra_postargs)
-+                if self.detect_language(src) == 'c++':
-+                    self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] +
-+                               extra_postargs)
-+                else:
-+                    self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
-+                               extra_postargs)
-             except DistutilsExecError as msg:
-                 raise CompileError(msg)
- 
 --- Lib/distutils/sysconfig.py
 +++ Lib/distutils/sysconfig.py
-@@ -191,9 +191,12 @@
+@@ -184,9 +184,12 @@
                  _osx_support.customize_compiler(_config_vars)
                  _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True'
  
  
          if 'CC' in os.environ:
              newcc = os.environ['CC']
-@@ -208,19 +211,27 @@
+@@ -201,19 +204,27 @@
              cxx = os.environ['CXX']
          if 'LDSHARED' in os.environ:
              ldshared = os.environ['LDSHARED']
          if 'AR' in os.environ:
              ar = os.environ['AR']
          if 'ARFLAGS' in os.environ:
-@@ -229,13 +240,17 @@
+@@ -222,13 +233,17 @@
              archiver = ar + ' ' + ar_flags
  
          cc_cmd = cc + ' ' + cflags
  _INITPRE = '_OSX_SUPPORT_INITIAL_'
 --- Makefile.pre.in
 +++ Makefile.pre.in
-@@ -496,7 +496,7 @@
+@@ -553,7 +553,7 @@
  	    *\ -s*|s*) quiet="-q";; \
  	    *) quiet="";; \
  	esac; \

File patches/22_all_tests_environment.patch

View file
  • Ignore whitespace
 
 --- Lib/site.py
 +++ Lib/site.py
-@@ -587,8 +587,9 @@
+@@ -540,8 +540,9 @@
      known_paths = venv(known_paths)
      if ENABLE_USER_SITE is None:
          ENABLE_USER_SITE = check_enableusersite()
 +    if os.environ.get("_PYTHONNOSITEPACKAGES") is None:
 +        known_paths = addusersitepackages(known_paths)
 +        known_paths = addsitepackages(known_paths)
-     if sys.platform == 'os2emx':
-         setBEGINLIBPATH()
      setquit()
+     setcopyright()
+     sethelper()
 --- Lib/test/regrtest.py
 +++ Lib/test/regrtest.py
-@@ -188,6 +188,7 @@
+@@ -143,6 +143,7 @@
  import unittest
  import warnings
  from inspect import isabstract
  
  try:
      import threading
-@@ -578,6 +579,62 @@
-     support.use_resources = use_resources
+@@ -432,7 +433,6 @@
+     subprocess exits, its return code, stdout and stderr are returned as a
+     3-tuple.
+     """
+-    from subprocess import Popen, PIPE
+     base_cmd = ([sys.executable] + support.args_from_interpreter_flags() +
+                 ['-X', 'faulthandler', '-m', 'test.regrtest'])
+ 
+@@ -643,6 +643,56 @@
+     support.use_resources = ns.use_resources
      save_modules = sys.modules.keys()
  
 +    opt_args = support.args_from_interpreter_flags()
-+    base_cmd = [sys.executable] + opt_args + ['-m', 'test.regrtest']
-+    debug_output_pat = re.compile(r"\[\d+ refs\]$")
-+
-+    def get_args_tuple(test, verbose, quiet, huntrleaks, debug, use_resources,
-+                       output_on_failure, failfast, match_tests, timeout):
-+        return (
-+            (test, verbose, quiet),
-+            dict(huntrleaks=huntrleaks, debug=debug,
-+                 use_resources=use_resources,
-+                 output_on_failure=output_on_failure, failfast=failfast,
-+                 match_tests=match_tests, timeout=timeout)
-+        )
++    base_cmd = [sys.executable] + opt_args
++    base_cmd += ['-X', 'faulthandler', '-m', 'test.regrtest']
++    debug_output_pat = re.compile(r"\[\d+ refs, \d+ blocks\]$")
 +
-+    def _runtest(test, verbose, quiet, huntrleaks=False, debug=False,
-+                 use_resources=None, output_on_failure=False, failfast=False,
-+                 match_tests=None, timeout=None):
++    def _runtest(test, verbose, quiet, huntrleaks=False, use_resources=None,
++                 output_on_failure=False, failfast=False, match_tests=None,
++                 timeout=None):
 +        if test == "test_site":
-+            args_tuple = get_args_tuple(test, verbose, quiet, huntrleaks, debug,
-+                                        use_resources, output_on_failure,
-+                                        failfast, match_tests, timeout)
++            slaveargs = ((test, verbose, quiet),
++                         dict(huntrleaks=huntrleaks,
++                              use_resources=use_resources,
++                              output_on_failure=output_on_failure,
++                              timeout=timeout, failfast=failfast,
++                              match_tests=match_tests))
 +            env = os.environ.copy()
 +            try:
 +                del env["_PYTHONNOSITEPACKAGES"]
 +            except KeyError:
 +                pass
-+            popen = Popen(base_cmd + ['--slaveargs', json.dumps(args_tuple)],
++            popen = Popen(base_cmd + ['--slaveargs', json.dumps(slaveargs)],
 +                          stdout=PIPE, stderr=PIPE,
 +                          universal_newlines=True,
 +                          close_fds=(os.name != 'nt'),
 +            return result
 +        else:
 +            return runtest(test, verbose, quiet, huntrleaks=huntrleaks,
-+                           debug=debug, use_resources=use_resources,
++                           use_resources=use_resources,
 +                           output_on_failure=output_on_failure,
 +                           failfast=failfast, match_tests=match_tests,
 +                           timeout=timeout)
      def accumulate_result(test, result):
          ok, test_time = result
          test_times.append((test_time, test))
-@@ -615,12 +672,8 @@
+@@ -680,7 +730,6 @@
              print("Multiprocess option requires thread support")
              sys.exit(2)
          from queue import Queue
--        from subprocess import Popen, PIPE
--        debug_output_pat = re.compile(r"\[\d+ refs\]$")
+-        debug_output_pat = re.compile(r"\[\d+ refs, \d+ blocks\]$")
          output = Queue()
          pending = MultiprocessTests(tests)
--        opt_args = support.args_from_interpreter_flags()
--        base_cmd = [sys.executable] + opt_args + ['-m', 'test.regrtest']
          def work():
-             # A worker thread.
-             try:
-@@ -630,13 +683,9 @@
-                     except StopIteration:
-                         output.put((None, None, None, None))
-                         return
--                    args_tuple = (
--                        (test, verbose, quiet),
--                        dict(huntrleaks=huntrleaks, use_resources=use_resources,
--                             debug=debug, output_on_failure=verbose3,
--                             timeout=timeout, failfast=failfast,
--                             match_tests=match_tests)
--                    )
-+                    args_tuple = get_args_tuple(test, verbose, quiet, huntrleaks,
-+                                                debug, use_resources, verbose3,
-+                                                failfast, match_tests, timeout)
-                     # -E is needed by some tests, e.g. test_import
-                     # Running the child from the same working directory ensures
-                     # that TEMPDIR for the child is the same when
-@@ -707,14 +756,14 @@
-             if trace:
+@@ -752,15 +801,15 @@
+             if ns.trace:
                  # If we're tracing code coverage, then we don't exit with status
                  # if on a false return value from main.
--                tracer.runctx('runtest(test, verbose, quiet, timeout=timeout)',
-+                tracer.runctx('_runtest(test, verbose, quiet, timeout=timeout)',
+-                tracer.runctx('runtest(test, ns.verbose, ns.quiet, timeout=ns.timeout)',
++                tracer.runctx('_runtest(test, ns.verbose, ns.quiet, timeout=ns.timeout)',
                                globals=globals(), locals=vars())
              else:
                  try:
--                    result = runtest(test, verbose, quiet, huntrleaks, debug,
--                                     output_on_failure=verbose3,
--                                     timeout=timeout, failfast=failfast,
--                                     match_tests=match_tests)
-+                    result = _runtest(test, verbose, quiet, huntrleaks, debug,
-+                                      output_on_failure=verbose3,
-+                                      timeout=timeout, failfast=failfast,
-+                                      match_tests=match_tests)
+-                    result = runtest(test, ns.verbose, ns.quiet,
+-                                     ns.huntrleaks,
+-                                     output_on_failure=ns.verbose3,
+-                                     timeout=ns.timeout, failfast=ns.failfast,
+-                                     match_tests=ns.match_tests)
++                    result = _runtest(test, ns.verbose, ns.quiet,
++                                      ns.huntrleaks,
++                                      output_on_failure=ns.verbose3,
++                                      timeout=ns.timeout, failfast=ns.failfast,
++                                      match_tests=ns.match_tests)
                      accumulate_result(test, result)
                  except KeyboardInterrupt:
                      interrupted = True
-@@ -785,7 +834,7 @@
+@@ -817,8 +866,8 @@
              sys.stdout.flush()
              try:
-                 verbose = True
--                ok = runtest(test, True, quiet, huntrleaks, debug, timeout=timeout)
-+                ok = _runtest(test, True, quiet, huntrleaks, debug, timeout=timeout)
+                 ns.verbose = True
+-                ok = runtest(test, True, ns.quiet, ns.huntrleaks,
+-                             timeout=ns.timeout)
++                ok = _runtest(test, True, ns.quiet, ns.huntrleaks,
++                              timeout=ns.timeout)
              except KeyboardInterrupt:
                  # print a newline separate from the ^C
                  print()
-@@ -1182,8 +1231,9 @@
+@@ -1239,8 +1288,9 @@
          for name, get, restore in self.resource_info():
              current = get()
              original = saved_values.pop(name)
  import test.support
  from test.support import captured_stderr, TESTFN, EnvironmentVarGuard
  import builtins
-+import imp
++import importlib
  import os
  import sys
  import re
  
 +if "_PYTHONNOSITEPACKAGES" in os.environ:
 +    del os.environ["_PYTHONNOSITEPACKAGES"]
-+    imp.reload(site)
++    importlib.reload(site)
 +
  if site.ENABLE_USER_SITE and not os.path.isdir(site.USER_SITE):
      # need to add user site directory for tests
      os.makedirs(site.USER_SITE)
 --- Makefile.pre.in
 +++ Makefile.pre.in
-@@ -883,7 +883,7 @@
+@@ -944,7 +944,7 @@
  ######################################################################
  
  TESTOPTS=	$(EXTRATESTOPTS)

File patches/24_all_sqlite-3.8.4.patch

View file
  • Ignore whitespace
 http://bugs.python.org/issue20901
-http://hg.python.org/cpython/rev/dbc9e3ed5e9f
+http://hg.python.org/cpython/rev/4d626a9df062
 
 --- Lib/sqlite3/test/hooks.py
 +++ Lib/sqlite3/test/hooks.py

File patches/61_all_process_data.patch

View file
  • Ignore whitespace
 
 --- Modules/main.c
 +++ Modules/main.c
-@@ -331,6 +331,7 @@
+@@ -343,6 +343,7 @@
      int version = 0;
      int saw_unbuffered_flag = 0;
      PyCompilerFlags cf;
  
      cf.cf_flags = 0;
  
-@@ -551,7 +552,17 @@
-             filename = argv[_PyOS_optind];
- 
- #else
+@@ -563,7 +564,17 @@
+     if (command == NULL && module == NULL && _PyOS_optind < argc &&
+         wcscmp(argv[_PyOS_optind], L"-") != 0)
+     {
 -        filename = argv[_PyOS_optind];
 +        if (target_script_name != NULL && *target_script_name != '\0') {
 +            size_t length = strlen(target_script_name);
 +        }
 +        if (filename == NULL)
 +            filename = argv[_PyOS_optind];
- #endif
      }
  
+     stdin_is_interactive = Py_FdIsInteractive(stdin, (char *)0);
 --- Modules/posixmodule.c
 +++ Modules/posixmodule.c
-@@ -1157,6 +1157,10 @@
+@@ -1239,6 +1239,10 @@
          char *p = strchr(*e, '=');
          if (p == NULL)
              continue;
  #ifdef MS_WINDOWS
  int
  wmain(int argc, wchar_t **argv)
-@@ -18,6 +26,11 @@
- int
- main(int argc, char **argv)
- {
+@@ -44,6 +52,11 @@
+     fpsetmask(m & ~FP_X_OFL);
+ #endif
+ 
 +    if (getenv("GENTOO_PYTHON_TARGET_SCRIPT_PATH_VERIFICATION")) {
 +        printf("GENTOO_PYTHON_TARGET_SCRIPT_PATH supported\n");
 +        return 0;
 +    }
 +
-     wchar_t **argv_copy;
-     /* We need a second copy, as Python might modify the first one. */
-     wchar_t **argv_copy2;
-@@ -59,6 +72,16 @@
+     oldloc = _PyMem_RawStrdup(setlocale(LC_ALL, NULL));
+     if (!oldloc) {
+         fprintf(stderr, "out of memory\n");
+@@ -66,6 +79,18 @@
  
      setlocale(LC_ALL, oldloc);
-     free(oldloc);
+     PyMem_RawFree(oldloc);
 +
 +#ifdef __linux__
-+    char *process_name = getenv("GENTOO_PYTHON_PROCESS_NAME");
++    {
++        char *process_name = getenv("GENTOO_PYTHON_PROCESS_NAME");
 +#ifdef HAVE_UNSETENV
-+    unsetenv("GENTOO_PYTHON_PROCESS_NAME");
++        unsetenv("GENTOO_PYTHON_PROCESS_NAME");
 +#endif
-+    if (process_name != NULL && *process_name != '\0')
-+        prctl(PR_SET_NAME, process_name);
++        if (process_name != NULL && *process_name != '\0')
++            prctl(PR_SET_NAME, process_name);
++    }
 +#endif
 +
      res = Py_Main(argc, argv_copy);
      for (i = 0; i < argc; i++) {
-         PyMem_Free(argv_copy2[i]);
+         PyMem_RawFree(argv_copy2[i]);
 --- Python/sysmodule.c
 +++ Python/sysmodule.c
-@@ -1778,6 +1778,10 @@
+@@ -1852,6 +1852,10 @@
  makeargvobject(int argc, wchar_t **argv)
  {
      PyObject *av;
      if (argc <= 0 || argv == NULL) {
          /* Ensure at least one (empty) argument is seen */
          static wchar_t *empty_argv[1] = {L""};
-@@ -1802,7 +1806,16 @@
-             } else
-                 v = PyUnicode_FromString(argv[i]);
- #else
+@@ -1862,7 +1866,16 @@
+     if (av != NULL) {
+         int i;
+         for (i = 0; i < argc; i++) {
 -            PyObject *v = PyUnicode_FromWideChar(argv[i], -1);
 +            PyObject *v = NULL;
 +            if (i == 0 && wrapper_script_name != NULL && *wrapper_script_name != '\0') {
 +            }
 +            if (v == NULL)
 +                v = PyUnicode_FromWideChar(argv[i], -1);
- #endif
              if (v == NULL) {
                  Py_DECREF(av);
-@@ -1822,7 +1835,12 @@
+                 av = NULL;
+@@ -1881,7 +1894,9 @@
  static void
  sys_update_path(int argc, wchar_t **argv)
  {
 -    wchar_t *argv0;
 +    char *target_script_name = getenv("GENTOO_PYTHON_TARGET_SCRIPT_PATH");
-+#ifdef HAVE_UNSETENV
-+    unsetenv("GENTOO_PYTHON_TARGET_SCRIPT_PATH");
-+#endif
 +    wchar_t *wcs_target_script_name = NULL;
 +    wchar_t *argv0 = NULL;
      wchar_t *p = NULL;
      Py_ssize_t n = 0;
      PyObject *a;
-@@ -1842,7 +1860,14 @@
+@@ -1896,12 +1911,22 @@
+ #elif defined(MS_WINDOWS) && !defined(MS_WINCE)
+     wchar_t fullpath[MAX_PATH];
+ #endif
++#ifdef HAVE_UNSETENV
++    unsetenv("GENTOO_PYTHON_TARGET_SCRIPT_PATH");
++#endif
+ 
+     path = _PySys_GetObjectId(&PyId_path);
      if (path == NULL)
          return;
  
  
  #ifdef HAVE_READLINK
      if (_HAVE_SCRIPT_ARGUMENT(argc, argv))
-@@ -1919,6 +1944,7 @@
+@@ -1978,6 +2003,7 @@
      if (PyList_Insert(path, 0, a) < 0)
          Py_FatalError("sys.path.insert(0) failed");
      Py_DECREF(a);