summaryrefslogtreecommitdiff
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2002-09-03 13:25:17 +0000
committerSkip Montanaro <skip@pobox.com>2002-09-03 13:25:17 +0000
commit8e790e700777cdb0fdecf3acaf53d5ad06784501 (patch)
treec97e4f4b1b7e606ab12c7671b1b6e9ed5fe7ebbd /Python/sysmodule.c
parentf62a89b1e09d84fbd60e0356b87430a6ff1e352d (diff)
downloadcpython-git-8e790e700777cdb0fdecf3acaf53d5ad06784501.tar.gz
expose PYTHON_API_VERSION macro as sys.api_version. Closes patch # 601456.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 4a0bf37622..cdacce3688 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -793,6 +793,9 @@ _PySys_Init(void)
PY_MICRO_VERSION, s,
PY_RELEASE_SERIAL));
Py_XDECREF(v);
+ PyDict_SetItemString(sysdict, "api_version",
+ v = PyInt_FromLong(PYTHON_API_VERSION));
+ Py_XDECREF(v);
PyDict_SetItemString(sysdict, "copyright",
v = PyString_FromString(Py_GetCopyright()));
Py_XDECREF(v);