]> granicus.if.org Git - python/commitdiff
bpo-29585: Fix sysconfig.get_config_var("PYTHONFRAMEWORK") (GH-2483)
authorINADA Naoki <methane@users.noreply.github.com>
Thu, 29 Jun 2017 06:31:38 +0000 (15:31 +0900)
committerGitHub <noreply@github.com>
Thu, 29 Jun 2017 06:31:38 +0000 (15:31 +0900)
`PYTHONFRAMEWORK` is defined in `Makefile` and it shoulnd't be used
in `pyconfig.h`.

`sysconfig.py --generate-posix-vars` reads config vars from Makefile
and `pyconfig.h`.  Conflicting variables should be avoided.

Especially, string config variables in Makefile are unquoted, but
in `pyconfig.h` are keep quoted.  So it should be private (starts with
underscore).

PC/pyconfig.h
Python/sysmodule.c
configure
configure.ac
pyconfig.h.in

index a2d024d6db000e743b295397fdd1f2dcd8e85a29..bab9d5aef9de6d7739fbb8cf75ff6ac0f75c596e 100644 (file)
@@ -694,6 +694,6 @@ Py_NO_ENABLE_SHARED to find out.  Also support MS_NO_COREDLL for b/w compat */
 #define HAVE_INET_PTON 1
 
 /* framework name */
-#define PYTHONFRAMEWORK ""
+#define _PYTHONFRAMEWORK ""
 
 #endif /* !Py_CONFIG_H */
index 84673e3fed973711d2a218c14f318be400d24d1b..ab435c83104ddc668fde289a073ce34dc65bb4be 100644 (file)
@@ -1965,7 +1965,7 @@ _PySys_BeginInit(void)
     SET_SYS_FROM_STRING("_git",
                         Py_BuildValue("(szz)", "CPython", _Py_gitidentifier(),
                                       _Py_gitversion()));
-    SET_SYS_FROM_STRING("_framework", PyUnicode_FromString(PYTHONFRAMEWORK));
+    SET_SYS_FROM_STRING("_framework", PyUnicode_FromString(_PYTHONFRAMEWORK));
     SET_SYS_FROM_STRING("api_version",
                         PyLong_FromLong(PYTHON_API_VERSION));
     SET_SYS_FROM_STRING("copyright",
index ff8152d7d19312d1c555dcf50e09a46c726cef7f..3a28cad9678a355870019396e653165517b5cf0e 100755 (executable)
--- a/configure
+++ b/configure
@@ -3245,7 +3245,7 @@ fi
 
 
 cat >>confdefs.h <<_ACEOF
-#define PYTHONFRAMEWORK "${PYTHONFRAMEWORK}"
+#define _PYTHONFRAMEWORK "${PYTHONFRAMEWORK}"
 _ACEOF
 
 
index 815769f534bedda84c8c51a67f5fe53a88031e85..8253102fc1debc1d7b923ba19bdc5965d4fa2793 100644 (file)
@@ -355,7 +355,7 @@ AC_SUBST(FRAMEWORKPYTHONW)
 AC_SUBST(FRAMEWORKUNIXTOOLSPREFIX)
 AC_SUBST(FRAMEWORKINSTALLAPPSPREFIX)
 
-AC_DEFINE_UNQUOTED(PYTHONFRAMEWORK, "${PYTHONFRAMEWORK}", [framework name])
+AC_DEFINE_UNQUOTED(_PYTHONFRAMEWORK, "${PYTHONFRAMEWORK}", [framework name])
 
 ##AC_ARG_WITH(dyld,
 ##            AS_HELP_STRING([--with-dyld],
index f7c50eadcafc126c82a623f81e4668e7b9fe5d27..b4d1f1b50384e4db1e5605fe4089b1d7ffa598f2 100644 (file)
 /* Define as the preferred size in bits of long digits */
 #undef PYLONG_BITS_IN_DIGIT
 
-/* framework name */
-#undef PYTHONFRAMEWORK
-
 /* Define if you want to coerce the C locale to a UTF-8 based locale */
 #undef PY_COERCE_C_LOCALE
 
 /* Define if you have POSIX threads, and your system does not define that. */
 #undef _POSIX_THREADS
 
+/* framework name */
+#undef _PYTHONFRAMEWORK
+
 /* Define to force use of thread-safe errno, h_errno, and other functions */
 #undef _REENTRANT