summaryrefslogtreecommitdiff
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorINADA Naoki <methane@users.noreply.github.com>2017-06-29 00:31:53 +0900
committerGitHub <noreply@github.com>2017-06-29 00:31:53 +0900
commita8f8d5b4bd30dbe0828550469d98f12d2ebb2ef4 (patch)
treec980c5c35f6c0a8710b7c3ea1bda301b67a395eb /Python/sysmodule.c
parent79d37ae979a65ada0b2ac820279ccc3b1cd41ba6 (diff)
downloadcpython-git-a8f8d5b4bd30dbe0828550469d98f12d2ebb2ef4.tar.gz
bpo-29585: optimize site.py startup time (GH-136)
Avoid importing `sysconfig` from `site` by copying minimum code. Python startup is 5% faster on Linux and 30% faster on macOS
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 424a88f708..84673e3fed 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -1965,6 +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("api_version",
PyLong_FromLong(PYTHON_API_VERSION));
SET_SYS_FROM_STRING("copyright",