diff --git a/include/pyutils.h b/include/pyutils.h index 116cf3d..927485b 100644 --- a/include/pyutils.h +++ b/include/pyutils.h @@ -44,5 +44,7 @@ PyObject* import_entrypoint(); void log_expt(int priority); +void pyfcgi_python_version(char[16]); + #endif diff --git a/src/conf.c b/src/conf.c index 05c736c..d71f5bf 100644 --- a/src/conf.c +++ b/src/conf.c @@ -32,8 +32,9 @@ void usage() void print_version(int fd) { - dprintf(fd, "%s\n", PACKAGE_STRING); - /**@todo TODO : get python version */ + char version[16]; + pyfcgi_python_version(version); + dprintf(fd, "%s\nPython %s\n", PACKAGE_STRING, version); } void default_conf() diff --git a/src/pyutils.c b/src/pyutils.c index c28370b..bb6733b 100644 --- a/src/pyutils.c +++ b/src/pyutils.c @@ -196,3 +196,9 @@ void log_expt(int priority) pyfcgi_log(priority, msg); } +void pyfcgi_python_version(char version[16]) +{ + snprintf(version, 16, "%d.%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION, + PY_MICRO_VERSION); +} +