Karsten Hopp 758ac3
To: vim_dev@googlegroups.com
Karsten Hopp 758ac3
Subject: Patch 7.3.212
Karsten Hopp 758ac3
Fcc: outbox
Karsten Hopp 758ac3
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 758ac3
Mime-Version: 1.0
Karsten Hopp 758ac3
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 758ac3
Content-Transfer-Encoding: 8bit
Karsten Hopp 758ac3
------------
Karsten Hopp 758ac3
Karsten Hopp 758ac3
Patch 7.3.212
Karsten Hopp 758ac3
Problem:    With Python 3.2 ":py3" fails.
Karsten Hopp 758ac3
Solution:   Move PyEval_InitThreads() to after Py_Initialize(). (Roland
Karsten Hopp 758ac3
            Puntaier)  Check abiflags in configure. (Andreas Behr)
Karsten Hopp 758ac3
Files:      src/if_python3.c, src/auto/configure, src/configure.in
Karsten Hopp 758ac3
Karsten Hopp 758ac3
Karsten Hopp 758ac3
*** ../mercurial/vim73/src/if_python3.c	2011-02-25 15:18:46.000000000 +0100
Karsten Hopp 758ac3
--- src/if_python3.c	2011-06-11 04:24:49.000000000 +0200
Karsten Hopp 758ac3
***************
Karsten Hopp 758ac3
*** 547,560 ****
Karsten Hopp 758ac3
  	Py_SetPythonHome(PYTHON3_HOME);
Karsten Hopp 758ac3
  #endif
Karsten Hopp 758ac3
  
Karsten Hopp 758ac3
- 	/* initialise threads */
Karsten Hopp 758ac3
- 	PyEval_InitThreads();
Karsten Hopp 758ac3
- 
Karsten Hopp 758ac3
  #if !defined(MACOS) || defined(MACOS_X_UNIX)
Karsten Hopp 758ac3
  	Py_Initialize();
Karsten Hopp 758ac3
  #else
Karsten Hopp 758ac3
  	PyMac_Initialize();
Karsten Hopp 758ac3
  #endif
Karsten Hopp 758ac3
  
Karsten Hopp 758ac3
  #ifdef DYNAMIC_PYTHON3
Karsten Hopp 758ac3
  	get_py3_exceptions();
Karsten Hopp 758ac3
--- 547,559 ----
Karsten Hopp 758ac3
  	Py_SetPythonHome(PYTHON3_HOME);
Karsten Hopp 758ac3
  #endif
Karsten Hopp 758ac3
  
Karsten Hopp 758ac3
  #if !defined(MACOS) || defined(MACOS_X_UNIX)
Karsten Hopp 758ac3
  	Py_Initialize();
Karsten Hopp 758ac3
  #else
Karsten Hopp 758ac3
  	PyMac_Initialize();
Karsten Hopp 758ac3
  #endif
Karsten Hopp 758ac3
+ 	/* initialise threads, must be after Py_Initialize() */
Karsten Hopp 758ac3
+ 	PyEval_InitThreads();
Karsten Hopp 758ac3
  
Karsten Hopp 758ac3
  #ifdef DYNAMIC_PYTHON3
Karsten Hopp 758ac3
  	get_py3_exceptions();
Karsten Hopp 758ac3
*** ../mercurial/vim73/src/auto/configure	2011-05-10 15:41:59.000000000 +0200
Karsten Hopp 758ac3
--- src/auto/configure	2011-06-12 21:33:16.000000000 +0200
Karsten Hopp 758ac3
***************
Karsten Hopp 758ac3
*** 5505,5510 ****
Karsten Hopp 758ac3
--- 5505,5527 ----
Karsten Hopp 758ac3
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python3_version" >&5
Karsten Hopp 758ac3
  $as_echo "$vi_cv_var_python3_version" >&6; }
Karsten Hopp 758ac3
  
Karsten Hopp 758ac3
+         { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's abiflags" >&5
Karsten Hopp 758ac3
+ $as_echo_n "checking Python's abiflags... " >&6; }
Karsten Hopp 758ac3
+ if test "${vi_cv_var_python3_abiflags+set}" = set; then :
Karsten Hopp 758ac3
+   $as_echo_n "(cached) " >&6
Karsten Hopp 758ac3
+ else
Karsten Hopp 758ac3
+ 
Karsten Hopp 758ac3
+      vi_cv_var_python3_abiflags=
Karsten Hopp 758ac3
+      if ${vi_cv_path_python3} -c \
Karsten Hopp 758ac3
+          "import sys; sys.exit(${vi_cv_var_python3_version} < 3.2)"
Karsten Hopp 758ac3
+      then
Karsten Hopp 758ac3
+        vi_cv_var_python3_abiflags=`${vi_cv_path_python3} -c \
Karsten Hopp 758ac3
+          "import sys; print(sys.abiflags)"`
Karsten Hopp 758ac3
+      fi
Karsten Hopp 758ac3
+ fi
Karsten Hopp 758ac3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python3_abiflags" >&5
Karsten Hopp 758ac3
+ $as_echo "$vi_cv_var_python3_abiflags" >&6; }
Karsten Hopp 758ac3
+ 
Karsten Hopp 758ac3
          { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's install prefix" >&5
Karsten Hopp 758ac3
  $as_echo_n "checking Python's install prefix... " >&6; }
Karsten Hopp 758ac3
  if test "${vi_cv_path_python3_pfx+set}" = set; then :
Karsten Hopp 758ac3
***************
Karsten Hopp 758ac3
*** 5555,5563 ****
Karsten Hopp 758ac3
  else
Karsten Hopp 758ac3
  
Karsten Hopp 758ac3
       vi_cv_path_python3_conf=
Karsten Hopp 758ac3
       for path in "${vi_cv_path_python3_pfx}" "${vi_cv_path_python3_epfx}"; do
Karsten Hopp 758ac3
         for subdir in lib64 lib share; do
Karsten Hopp 758ac3
!          d="${path}/${subdir}/python${vi_cv_var_python3_version}/config"
Karsten Hopp 758ac3
           if test -d "$d" && test -f "$d/config.c"; then
Karsten Hopp 758ac3
             vi_cv_path_python3_conf="$d"
Karsten Hopp 758ac3
           fi
Karsten Hopp 758ac3
--- 5572,5584 ----
Karsten Hopp 758ac3
  else
Karsten Hopp 758ac3
  
Karsten Hopp 758ac3
       vi_cv_path_python3_conf=
Karsten Hopp 758ac3
+      config_dir="config"
Karsten Hopp 758ac3
+      if test "${vi_cv_var_python3_abiflags}" != ""; then
Karsten Hopp 758ac3
+        config_dir="${config_dir}-${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}"
Karsten Hopp 758ac3
+      fi
Karsten Hopp 758ac3
       for path in "${vi_cv_path_python3_pfx}" "${vi_cv_path_python3_epfx}"; do
Karsten Hopp 758ac3
         for subdir in lib64 lib share; do
Karsten Hopp 758ac3
!          d="${path}/${subdir}/python${vi_cv_var_python3_version}/${config_dir}"
Karsten Hopp 758ac3
           if test -d "$d" && test -f "$d/config.c"; then
Karsten Hopp 758ac3
             vi_cv_path_python3_conf="$d"
Karsten Hopp 758ac3
           fi
Karsten Hopp 758ac3
***************
Karsten Hopp 758ac3
*** 5592,5598 ****
Karsten Hopp 758ac3
                      eval "`cd ${PYTHON3_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
Karsten Hopp 758ac3
            rm -f -- "${tmp_mkf}"
Karsten Hopp 758ac3
            vi_cv_path_python3_plibs="-L${PYTHON3_CONFDIR} -lpython${vi_cv_var_python3_version}"
Karsten Hopp 758ac3
!           vi_cv_path_python3_plibs="${vi_cv_path_python3_plibs} ${python3_BASEMODLIBS} ${python3_LIBS} ${python3_SYSLIBS} ${python3_LINKFORSHARED}"
Karsten Hopp 758ac3
                      vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-ltermcap//`
Karsten Hopp 758ac3
            vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-lffi//`
Karsten Hopp 758ac3
  
Karsten Hopp 758ac3
--- 5613,5619 ----
Karsten Hopp 758ac3
                      eval "`cd ${PYTHON3_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
Karsten Hopp 758ac3
            rm -f -- "${tmp_mkf}"
Karsten Hopp 758ac3
            vi_cv_path_python3_plibs="-L${PYTHON3_CONFDIR} -lpython${vi_cv_var_python3_version}"
Karsten Hopp 758ac3
!           vi_cv_path_python3_plibs="${vi_cv_path_python3_plibs} ${python3_BASEMODLIBS} ${python3_LIBS} ${python3_SYSLIBS}"
Karsten Hopp 758ac3
                      vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-ltermcap//`
Karsten Hopp 758ac3
            vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-lffi//`
Karsten Hopp 758ac3
  
Karsten Hopp 758ac3
***************
Karsten Hopp 758ac3
*** 5601,5609 ****
Karsten Hopp 758ac3
  
Karsten Hopp 758ac3
        PYTHON3_LIBS="${vi_cv_path_python3_plibs}"
Karsten Hopp 758ac3
        if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then
Karsten Hopp 758ac3
!         PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
Karsten Hopp 758ac3
        else
Karsten Hopp 758ac3
!         PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
Karsten Hopp 758ac3
        fi
Karsten Hopp 758ac3
        PYTHON3_SRC="if_python3.c"
Karsten Hopp 758ac3
              if test "x$MACOSX" = "xyes"; then
Karsten Hopp 758ac3
--- 5622,5630 ----
Karsten Hopp 758ac3
  
Karsten Hopp 758ac3
        PYTHON3_LIBS="${vi_cv_path_python3_plibs}"
Karsten Hopp 758ac3
        if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then
Karsten Hopp 758ac3
!         PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
Karsten Hopp 758ac3
        else
Karsten Hopp 758ac3
!         PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
Karsten Hopp 758ac3
        fi
Karsten Hopp 758ac3
        PYTHON3_SRC="if_python3.c"
Karsten Hopp 758ac3
              if test "x$MACOSX" = "xyes"; then
Karsten Hopp 758ac3
*** ../mercurial/vim73/src/configure.in	2011-05-10 15:41:59.000000000 +0200
Karsten Hopp 758ac3
--- src/configure.in	2011-06-12 21:31:18.000000000 +0200
Karsten Hopp 758ac3
***************
Karsten Hopp 758ac3
*** 992,997 ****
Karsten Hopp 758ac3
--- 992,1008 ----
Karsten Hopp 758ac3
            ${vi_cv_path_python3} -c 'import sys; print(sys.version[:3])'`
Karsten Hopp 758ac3
      ]])
Karsten Hopp 758ac3
  
Karsten Hopp 758ac3
+     dnl -- get abiflags for python 3.2 or higher (PEP 3149)
Karsten Hopp 758ac3
+     AC_CACHE_CHECK(Python's abiflags,vi_cv_var_python3_abiflags,
Karsten Hopp 758ac3
+     [
Karsten Hopp 758ac3
+      vi_cv_var_python3_abiflags=
Karsten Hopp 758ac3
+      if ${vi_cv_path_python3} -c \
Karsten Hopp 758ac3
+          "import sys; sys.exit(${vi_cv_var_python3_version} < 3.2)"
Karsten Hopp 758ac3
+      then
Karsten Hopp 758ac3
+        vi_cv_var_python3_abiflags=`${vi_cv_path_python3} -c \    
Karsten Hopp 758ac3
+          "import sys; print(sys.abiflags)"`
Karsten Hopp 758ac3
+      fi ])
Karsten Hopp 758ac3
+ 
Karsten Hopp 758ac3
      dnl -- find where python3 thinks it was installed
Karsten Hopp 758ac3
      AC_CACHE_CHECK(Python's install prefix,vi_cv_path_python3_pfx,
Karsten Hopp 758ac3
      [ vi_cv_path_python3_pfx=`
Karsten Hopp 758ac3
***************
Karsten Hopp 758ac3
*** 1021,1029 ****
Karsten Hopp 758ac3
      AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python3_conf,
Karsten Hopp 758ac3
      [
Karsten Hopp 758ac3
       vi_cv_path_python3_conf=
Karsten Hopp 758ac3
       for path in "${vi_cv_path_python3_pfx}" "${vi_cv_path_python3_epfx}"; do
Karsten Hopp 758ac3
         for subdir in lib64 lib share; do
Karsten Hopp 758ac3
!          d="${path}/${subdir}/python${vi_cv_var_python3_version}/config"
Karsten Hopp 758ac3
           if test -d "$d" && test -f "$d/config.c"; then
Karsten Hopp 758ac3
             vi_cv_path_python3_conf="$d"
Karsten Hopp 758ac3
           fi
Karsten Hopp 758ac3
--- 1032,1044 ----
Karsten Hopp 758ac3
      AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python3_conf,
Karsten Hopp 758ac3
      [
Karsten Hopp 758ac3
       vi_cv_path_python3_conf=
Karsten Hopp 758ac3
+      config_dir="config"
Karsten Hopp 758ac3
+      if test "${vi_cv_var_python3_abiflags}" != ""; then
Karsten Hopp 758ac3
+        config_dir="${config_dir}-${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}"
Karsten Hopp 758ac3
+      fi
Karsten Hopp 758ac3
       for path in "${vi_cv_path_python3_pfx}" "${vi_cv_path_python3_epfx}"; do
Karsten Hopp 758ac3
         for subdir in lib64 lib share; do
Karsten Hopp 758ac3
!          d="${path}/${subdir}/python${vi_cv_var_python3_version}/${config_dir}"
Karsten Hopp 758ac3
           if test -d "$d" && test -f "$d/config.c"; then
Karsten Hopp 758ac3
             vi_cv_path_python3_conf="$d"
Karsten Hopp 758ac3
           fi
Karsten Hopp 758ac3
***************
Karsten Hopp 758ac3
*** 1055,1061 ****
Karsten Hopp 758ac3
            eval "`cd ${PYTHON3_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
Karsten Hopp 758ac3
            rm -f -- "${tmp_mkf}"
Karsten Hopp 758ac3
            vi_cv_path_python3_plibs="-L${PYTHON3_CONFDIR} -lpython${vi_cv_var_python3_version}"
Karsten Hopp 758ac3
!           vi_cv_path_python3_plibs="${vi_cv_path_python3_plibs} ${python3_BASEMODLIBS} ${python3_LIBS} ${python3_SYSLIBS} ${python3_LINKFORSHARED}"
Karsten Hopp 758ac3
            dnl remove -ltermcap, it can conflict with an earlier -lncurses
Karsten Hopp 758ac3
            vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-ltermcap//`
Karsten Hopp 758ac3
            vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-lffi//`
Karsten Hopp 758ac3
--- 1070,1076 ----
Karsten Hopp 758ac3
            eval "`cd ${PYTHON3_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
Karsten Hopp 758ac3
            rm -f -- "${tmp_mkf}"
Karsten Hopp 758ac3
            vi_cv_path_python3_plibs="-L${PYTHON3_CONFDIR} -lpython${vi_cv_var_python3_version}"
Karsten Hopp 758ac3
!           vi_cv_path_python3_plibs="${vi_cv_path_python3_plibs} ${python3_BASEMODLIBS} ${python3_LIBS} ${python3_SYSLIBS}"
Karsten Hopp 758ac3
            dnl remove -ltermcap, it can conflict with an earlier -lncurses
Karsten Hopp 758ac3
            vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-ltermcap//`
Karsten Hopp 758ac3
            vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-lffi//`
Karsten Hopp 758ac3
***************
Karsten Hopp 758ac3
*** 1063,1071 ****
Karsten Hopp 758ac3
  
Karsten Hopp 758ac3
        PYTHON3_LIBS="${vi_cv_path_python3_plibs}"
Karsten Hopp 758ac3
        if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then
Karsten Hopp 758ac3
!         PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
Karsten Hopp 758ac3
        else
Karsten Hopp 758ac3
!         PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
Karsten Hopp 758ac3
        fi
Karsten Hopp 758ac3
        PYTHON3_SRC="if_python3.c"
Karsten Hopp 758ac3
        dnl For Mac OSX 10.2 config.o is included in the Python library.
Karsten Hopp 758ac3
--- 1078,1086 ----
Karsten Hopp 758ac3
  
Karsten Hopp 758ac3
        PYTHON3_LIBS="${vi_cv_path_python3_plibs}"
Karsten Hopp 758ac3
        if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then
Karsten Hopp 758ac3
!         PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
Karsten Hopp 758ac3
        else
Karsten Hopp 758ac3
!         PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
Karsten Hopp 758ac3
        fi
Karsten Hopp 758ac3
        PYTHON3_SRC="if_python3.c"
Karsten Hopp 758ac3
        dnl For Mac OSX 10.2 config.o is included in the Python library.
Karsten Hopp 758ac3
*** ../vim-7.3.211/src/version.c	2011-06-12 21:24:56.000000000 +0200
Karsten Hopp 758ac3
--- src/version.c	2011-06-12 21:35:31.000000000 +0200
Karsten Hopp 758ac3
***************
Karsten Hopp 758ac3
*** 711,712 ****
Karsten Hopp 758ac3
--- 711,714 ----
Karsten Hopp 758ac3
  {   /* Add new patch number below this line */
Karsten Hopp 758ac3
+ /**/
Karsten Hopp 758ac3
+     212,
Karsten Hopp 758ac3
  /**/
Karsten Hopp 758ac3
Karsten Hopp 758ac3
-- 
Karsten Hopp 758ac3
In Joseph Heller's novel "Catch-22", the main character tries to get out of a
Karsten Hopp 758ac3
war by proving he is crazy.  But the mere fact he wants to get out of the war
Karsten Hopp 758ac3
only shows he isn't crazy -- creating the original "Catch-22".
Karsten Hopp 758ac3
Karsten Hopp 758ac3
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 758ac3
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 758ac3
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 758ac3
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///