diff options
-rw-r--r-- | lnt/testing/profile/cPerf.cpp | 20 | ||||
-rw-r--r-- | requirements.client.txt | 2 | ||||
-rw-r--r-- | setup.py | 5 |
3 files changed, 24 insertions, 3 deletions
diff --git a/lnt/testing/profile/cPerf.cpp b/lnt/testing/profile/cPerf.cpp index df823f6..fb5f7b3 100644 --- a/lnt/testing/profile/cPerf.cpp +++ b/lnt/testing/profile/cPerf.cpp @@ -812,7 +812,25 @@ static PyMethodDef cPerfMethods[] = {{"importPerf", cPerf_importPerf, "Import perf.data from a filename"}, {NULL, NULL, 0, NULL}}; -PyMODINIT_FUNC initcPerf(void) { (void)Py_InitModule("cPerf", cPerfMethods); } +#if PY_MAJOR_VERSION >= 3 +static PyModuleDef cPerfModuleDef = {PyModuleDef_HEAD_INIT, + "cPerf", + nullptr, + -1, + cPerfMethods, + nullptr, + nullptr, + nullptr, + nullptr}; +#endif + +PyMODINIT_FUNC initcPerf(void) { +#if PY_MAJOR_VERSION >= 3 + return PyModule_Create(&cPerfModuleDef); +#else + (void)Py_InitModule("cPerf", cPerfMethods); +#endif +} #else // STANDALONE diff --git a/requirements.client.txt b/requirements.client.txt index f1fe89f..2d919b0 100644 --- a/requirements.client.txt +++ b/requirements.client.txt @@ -7,12 +7,10 @@ Jinja2==2.7.2 MarkupSafe==0.23 SQLAlchemy==1.1.11 Werkzeug==0.12.2 -argparse==1.3.0 itsdangerous==0.24 python-dateutil==2.6.0 python-gnupg==0.3.7 pytz==2016.10 -wsgiref==0.1.2 WTForms==2.0.2 Flask-WTF==0.12 typing @@ -9,6 +9,9 @@ from sys import platform as _platform import sys from setuptools import setup, find_packages, Extension +if sys.version_info < (2, 7): + raise RuntimeError("Python 2.7 or higher required.") + cflags = [] if _platform == "darwin": @@ -124,4 +127,6 @@ http://llvm.org/svn/llvm-project/lnt/trunk install_requires=reqs, ext_modules=[cPerf], + + python_requires='>=2.7', ) |