From 653909febc1d8993e67135d0a316570fb52a9be2 Mon Sep 17 00:00:00 2001 From: Jacob Callahan Date: Fri, 10 Nov 2023 17:23:19 -0500 Subject: [PATCH] Additional 3.12 compatibility changes This included a number of changes related to the CPython API. I additionally bumped the supported python versions in CI. --- .circleci/config.yml | 16 ++++++++-------- setup.py | 4 ++-- ssh2/agent.c | 10 +++++++--- ssh2/channel.c | 10 +++++++--- ssh2/error_codes.c | 6 +++--- ssh2/exceptions.c | 6 +++--- ssh2/fileinfo.c | 10 +++++++--- ssh2/knownhost.c | 10 +++++++--- ssh2/listener.c | 10 +++++++--- ssh2/pkey.c | 10 +++++++--- ssh2/publickey.c | 10 +++++++--- ssh2/session.c | 10 +++++++--- ssh2/sftp.c | 10 +++++++--- ssh2/sftp_handle.c | 10 +++++++--- ssh2/statinfo.c | 10 +++++++--- ssh2/utils.c | 10 +++++++--- 16 files changed, 100 insertions(+), 52 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 63b4f237..a6ccb9e8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,21 +16,21 @@ version: 2.1 orbs: - python: circleci/python@0.3.2 + python: circleci/python@2.0.3 jobs: python_test: parameters: python_ver: type: string - default: "3.6" + default: "3.11" docker: - image: circleci/python:<< parameters.python_ver >> steps: - checkout - - python/load-cache: - dependency-file: requirements_dev.txt - key: depsv3-{{ .Branch }}.{{ arch }}-PY<< parameters.python_ver >> + # - python/load-cache: # This command is unavailable in the orb + # dependency-file: requirements_dev.txt + # key: depsv3-{{ .Branch }}.{{ arch }}-PY<< parameters.python_ver >> - run: name: Deps command: | @@ -139,17 +139,17 @@ jobs: steps: *manylinux-steps workflows: - version: 2.1 + # version: 2.1 - default? main: jobs: - python_test: matrix: parameters: python_ver: - - "3.6" - "3.8" - - "3.9" - "3.10" + - "3.11" + - "3.12" filters: tags: ignore: /.*/ diff --git a/setup.py b/setup.py index b27c637c..f9e1b401 100644 --- a/setup.py +++ b/setup.py @@ -13,6 +13,7 @@ try: from Cython.Distutils.extension import Extension from Cython.Distutils import build_ext + from Cython.Build import cythonize except ImportError: from setuptools import Extension USING_CYTHON = False @@ -71,7 +72,6 @@ library_dirs=[_lib_dir], runtime_library_dirs=runtime_library_dirs, extra_compile_args=_comp_args, - **cython_args, ) for i in range(len(sources))] @@ -131,6 +131,6 @@ 'Operating System :: Microsoft :: Windows', 'Operating System :: MacOS :: MacOS X', ], - ext_modules=extensions, + ext_modules=cythonize(extensions, **cython_args) if USING_CYTHON else extensions, package_data=package_data, ) diff --git a/ssh2/agent.c b/ssh2/agent.c index c483d66c..fe6b6a9e 100644 --- a/ssh2/agent.c +++ b/ssh2/agent.c @@ -202,7 +202,7 @@ #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) && (PY_VERSION_HEX < 0x030C00A6) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS @@ -229,7 +229,7 @@ #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 - #elif !defined(CYTHON_FAST_THREAD_STATE) + #elif !defined(CYTHON_FAST_THREAD_STATE) && (PY_VERSION_HEX < 0x030C00A6) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL @@ -242,7 +242,7 @@ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK @@ -5251,6 +5251,10 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); +#elif !CYTHON_FAST_THREAD_STATE + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + PyErr_NormalizeException(&type, &value, &traceback); #else PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; diff --git a/ssh2/channel.c b/ssh2/channel.c index 79280b8b..a10fdccd 100644 --- a/ssh2/channel.c +++ b/ssh2/channel.c @@ -202,7 +202,7 @@ #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) && (PY_VERSION_HEX < 0x030C00A6) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS @@ -229,7 +229,7 @@ #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 - #elif !defined(CYTHON_FAST_THREAD_STATE) + #elif !defined(CYTHON_FAST_THREAD_STATE) && (PY_VERSION_HEX < 0x030C00A6) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL @@ -242,7 +242,7 @@ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK @@ -9269,6 +9269,10 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); +#elif !CYTHON_FAST_THREAD_STATE + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + PyErr_NormalizeException(&type, &value, &traceback); #else PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; diff --git a/ssh2/error_codes.c b/ssh2/error_codes.c index 0cc3f814..fa16e008 100644 --- a/ssh2/error_codes.c +++ b/ssh2/error_codes.c @@ -202,7 +202,7 @@ #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) && (PY_VERSION_HEX < 0x030C00A6) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS @@ -229,7 +229,7 @@ #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 - #elif !defined(CYTHON_FAST_THREAD_STATE) + #elif !defined(CYTHON_FAST_THREAD_STATE) && (PY_VERSION_HEX < 0x030C00A6) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL @@ -242,7 +242,7 @@ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK diff --git a/ssh2/exceptions.c b/ssh2/exceptions.c index d580daa4..5e62c202 100644 --- a/ssh2/exceptions.c +++ b/ssh2/exceptions.c @@ -202,7 +202,7 @@ #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) && (PY_VERSION_HEX < 0x030C00A6) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS @@ -229,7 +229,7 @@ #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 - #elif !defined(CYTHON_FAST_THREAD_STATE) + #elif !defined(CYTHON_FAST_THREAD_STATE) && (PY_VERSION_HEX < 0x030C00A6) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL @@ -242,7 +242,7 @@ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK diff --git a/ssh2/fileinfo.c b/ssh2/fileinfo.c index 261bd114..7e262de9 100644 --- a/ssh2/fileinfo.c +++ b/ssh2/fileinfo.c @@ -202,7 +202,7 @@ #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) && (PY_VERSION_HEX < 0x030C00A6) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS @@ -229,7 +229,7 @@ #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 - #elif !defined(CYTHON_FAST_THREAD_STATE) + #elif !defined(CYTHON_FAST_THREAD_STATE) && (PY_VERSION_HEX < 0x030C00A6) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL @@ -242,7 +242,7 @@ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK @@ -3190,6 +3190,10 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); +#elif !CYTHON_FAST_THREAD_STATE + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + PyErr_NormalizeException(&type, &value, &traceback); #else PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; diff --git a/ssh2/knownhost.c b/ssh2/knownhost.c index 85cf8f0d..a15af191 100644 --- a/ssh2/knownhost.c +++ b/ssh2/knownhost.c @@ -202,7 +202,7 @@ #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) && (PY_VERSION_HEX < 0x030C00A6) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS @@ -229,7 +229,7 @@ #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 - #elif !defined(CYTHON_FAST_THREAD_STATE) + #elif !defined(CYTHON_FAST_THREAD_STATE) && (PY_VERSION_HEX < 0x030C00A6) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL @@ -242,7 +242,7 @@ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK @@ -8144,6 +8144,10 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); +#elif !CYTHON_FAST_THREAD_STATE + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + PyErr_NormalizeException(&type, &value, &traceback); #else PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; diff --git a/ssh2/listener.c b/ssh2/listener.c index f7b3b8fc..f40efe40 100644 --- a/ssh2/listener.c +++ b/ssh2/listener.c @@ -202,7 +202,7 @@ #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) && (PY_VERSION_HEX < 0x030C00A6) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS @@ -229,7 +229,7 @@ #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 - #elif !defined(CYTHON_FAST_THREAD_STATE) + #elif !defined(CYTHON_FAST_THREAD_STATE) && (PY_VERSION_HEX < 0x030C00A6) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL @@ -242,7 +242,7 @@ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK @@ -2931,6 +2931,10 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); +#elif !CYTHON_FAST_THREAD_STATE + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + PyErr_NormalizeException(&type, &value, &traceback); #else PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; diff --git a/ssh2/pkey.c b/ssh2/pkey.c index 8bd3b4e7..f6b1a559 100644 --- a/ssh2/pkey.c +++ b/ssh2/pkey.c @@ -202,7 +202,7 @@ #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) && (PY_VERSION_HEX < 0x030C00A6) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS @@ -229,7 +229,7 @@ #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 - #elif !defined(CYTHON_FAST_THREAD_STATE) + #elif !defined(CYTHON_FAST_THREAD_STATE) && (PY_VERSION_HEX < 0x030C00A6) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL @@ -242,7 +242,7 @@ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK @@ -2735,6 +2735,10 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); +#elif !CYTHON_FAST_THREAD_STATE + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + PyErr_NormalizeException(&type, &value, &traceback); #else PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; diff --git a/ssh2/publickey.c b/ssh2/publickey.c index 166c2446..92f901d2 100644 --- a/ssh2/publickey.c +++ b/ssh2/publickey.c @@ -202,7 +202,7 @@ #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) && (PY_VERSION_HEX < 0x030C00A6) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS @@ -229,7 +229,7 @@ #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 - #elif !defined(CYTHON_FAST_THREAD_STATE) + #elif !defined(CYTHON_FAST_THREAD_STATE) && (PY_VERSION_HEX < 0x030C00A6) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL @@ -242,7 +242,7 @@ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK @@ -6538,6 +6538,10 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); +#elif !CYTHON_FAST_THREAD_STATE + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + PyErr_NormalizeException(&type, &value, &traceback); #else PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; diff --git a/ssh2/session.c b/ssh2/session.c index 4083177e..f6a642a0 100644 --- a/ssh2/session.c +++ b/ssh2/session.c @@ -202,7 +202,7 @@ #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) && (PY_VERSION_HEX < 0x030C00A6) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS @@ -229,7 +229,7 @@ #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 - #elif !defined(CYTHON_FAST_THREAD_STATE) + #elif !defined(CYTHON_FAST_THREAD_STATE) && (PY_VERSION_HEX < 0x030C00A6) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL @@ -242,7 +242,7 @@ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK @@ -12645,6 +12645,10 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); +#elif !CYTHON_FAST_THREAD_STATE + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + PyErr_NormalizeException(&type, &value, &traceback); #else PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; diff --git a/ssh2/sftp.c b/ssh2/sftp.c index 0742948e..5a15558e 100644 --- a/ssh2/sftp.c +++ b/ssh2/sftp.c @@ -202,7 +202,7 @@ #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) && (PY_VERSION_HEX < 0x030C00A6) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS @@ -229,7 +229,7 @@ #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 - #elif !defined(CYTHON_FAST_THREAD_STATE) + #elif !defined(CYTHON_FAST_THREAD_STATE) && (PY_VERSION_HEX < 0x030C00A6) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL @@ -242,7 +242,7 @@ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK @@ -7286,6 +7286,10 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); +#elif !CYTHON_FAST_THREAD_STATE + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + PyErr_NormalizeException(&type, &value, &traceback); #else PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; diff --git a/ssh2/sftp_handle.c b/ssh2/sftp_handle.c index 344c99ca..8771fc66 100644 --- a/ssh2/sftp_handle.c +++ b/ssh2/sftp_handle.c @@ -202,7 +202,7 @@ #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) && (PY_VERSION_HEX < 0x030C00A6) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS @@ -229,7 +229,7 @@ #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 - #elif !defined(CYTHON_FAST_THREAD_STATE) + #elif !defined(CYTHON_FAST_THREAD_STATE) && (PY_VERSION_HEX < 0x030C00A6) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL @@ -242,7 +242,7 @@ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK @@ -10584,6 +10584,10 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); +#elif !CYTHON_FAST_THREAD_STATE + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + PyErr_NormalizeException(&type, &value, &traceback); #else PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; diff --git a/ssh2/statinfo.c b/ssh2/statinfo.c index 40c66651..51a42f43 100644 --- a/ssh2/statinfo.c +++ b/ssh2/statinfo.c @@ -202,7 +202,7 @@ #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) && (PY_VERSION_HEX < 0x030C00A6) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS @@ -229,7 +229,7 @@ #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 - #elif !defined(CYTHON_FAST_THREAD_STATE) + #elif !defined(CYTHON_FAST_THREAD_STATE) && (PY_VERSION_HEX < 0x030C00A6) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL @@ -242,7 +242,7 @@ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK @@ -3215,6 +3215,10 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); +#elif !CYTHON_FAST_THREAD_STATE + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + PyErr_NormalizeException(&type, &value, &traceback); #else PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; diff --git a/ssh2/utils.c b/ssh2/utils.c index ee142186..c85119ba 100644 --- a/ssh2/utils.c +++ b/ssh2/utils.c @@ -202,7 +202,7 @@ #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) && (PY_VERSION_HEX < 0x030C00A6) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS @@ -229,7 +229,7 @@ #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 - #elif !defined(CYTHON_FAST_THREAD_STATE) + #elif !defined(CYTHON_FAST_THREAD_STATE) && (PY_VERSION_HEX < 0x030C00A6) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL @@ -242,7 +242,7 @@ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK @@ -5557,6 +5557,10 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); +#elif !CYTHON_FAST_THREAD_STATE + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + PyErr_NormalizeException(&type, &value, &traceback); #else PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback;