From abe89a4f34624013d6129383ab5997ea7e7abac0 Mon Sep 17 00:00:00 2001 From: Jacob Callahan Date: Mon, 13 Nov 2023 09:26:10 -0500 Subject: [PATCH] re-cythonize with a constrained cython version Constrained the Cython version to be less than 3.0, but greater than 0.29.34. Updated the setup.py to account for the updated cythonize parameters. Also made the appveyor version PEP440 compatible --- ci/appveyor/fix_version.py | 3 +- requirements_dev.txt | 2 +- setup.py | 6 +- ssh2/agent.c | 204 ++++++++++++++++--------- ssh2/channel.c | 201 ++++++++++++++++--------- ssh2/error_codes.c | 96 ++++++++---- ssh2/fileinfo.c | 118 +++++++++------ ssh2/knownhost.c | 207 ++++++++++++++++---------- ssh2/listener.c | 195 +++++++++++++++--------- ssh2/pkey.c | 118 +++++++++------ ssh2/publickey.c | 212 ++++++++++++++++---------- ssh2/session.c | 296 ++++++++++++++++++++++--------------- ssh2/sftp.c | 220 +++++++++++++++++---------- ssh2/sftp_handle.c | 226 +++++++++++++++++----------- ssh2/statinfo.c | 116 +++++++++------ ssh2/utils.c | 194 +++++++++++++++--------- 16 files changed, 1536 insertions(+), 878 deletions(-) diff --git a/ci/appveyor/fix_version.py b/ci/appveyor/fix_version.py index 0f8e484a..543e6431 100644 --- a/ci/appveyor/fix_version.py +++ b/ci/appveyor/fix_version.py @@ -5,7 +5,8 @@ import sys def get_describe_tag(): - return subprocess.check_output(['git', 'describe', '--tags']).strip().decode('utf-8') + ver, change, *rem = subprocess.check_output(['git', 'describe', '--tags']).strip().decode('utf-8') + return f"{ver}+{change}.{'.'.join(rem)}" # PEP440 compatible def make_version_file(basedir): rev = os.environ.get('APPVEYOR_REPO_COMMIT', diff --git a/requirements_dev.txt b/requirements_dev.txt index c20000f7..e6c28682 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,4 +1,4 @@ -cython +cython>=0.29.34,<3.0.0 flake8 jinja2 sphinx diff --git a/setup.py b/setup.py index f9e1b401..2697a4f7 100644 --- a/setup.py +++ b/setup.py @@ -45,15 +45,15 @@ _fwd_default = 0 _comp_args = ["-O2"] if not ON_WINDOWS else None -cython_directives = {'embedsignature': True, +compiler_directives = {'embedsignature': True, 'boundscheck': False, 'optimize.use_switch': True, 'wraparound': False, 'language_level': 2, } cython_args = { - 'cython_directives': cython_directives, - 'cython_compile_time_env': {}, + 'compiler_directives': compiler_directives, + 'compile_time_env': {}, } if USING_CYTHON: diff --git a/ssh2/agent.c b/ssh2/agent.c index fe6b6a9e..78dc54a6 100644 --- a/ssh2/agent.c +++ b/ssh2/agent.c @@ -1,4 +1,37 @@ -/* Generated by Cython 0.29.32 */ +/* Generated by Cython 0.29.36 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "libssh2/include/libssh2.h", + "ssh2/ext/find_eol.h" + ], + "extra_compile_args": [ + "-O2" + ], + "include_dirs": [ + "./ssh2", + "ssh2", + "libssh2/include" + ], + "libraries": [ + "ssh2" + ], + "library_dirs": [ + "/home/jake/Programming/ssh2-python/build_dir/src" + ], + "name": "ssh2.agent", + "runtime_library_dirs": [ + "$ORIGIN/." + ], + "sources": [ + "ssh2/agent.pyx" + ] + }, + "module_name": "ssh2.agent" +} +END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN @@ -9,8 +42,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_32" -#define CYTHON_HEX_VERSION 0x001D20F0 +#define CYTHON_ABI "0_29_36" +#define CYTHON_HEX_VERSION 0x001D24F0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -78,16 +111,20 @@ #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900) + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 @@ -202,8 +239,8 @@ #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) && (PY_VERSION_HEX < 0x030C00A6) - #define CYTHON_USE_PYLONG_INTERNALS 1 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5) #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 @@ -229,7 +266,7 @@ #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 - #elif !defined(CYTHON_FAST_THREAD_STATE) && (PY_VERSION_HEX < 0x030C00A6) + #elif !defined(CYTHON_FAST_THREAD_STATE) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL @@ -242,7 +279,7 @@ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5)) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK @@ -365,9 +402,6 @@ #endif #endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define Py_OptimizeFlag 0 -#endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 @@ -445,6 +479,11 @@ #endif #define __Pyx_DefaultClassType PyType_Type #endif +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif @@ -552,11 +591,11 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 - #if defined(PyUnicode_IS_READY) - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) #else - #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) @@ -565,14 +604,14 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) - #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) - #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) - #endif + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif #endif #else #define CYTHON_PEP393_ENABLED 0 @@ -1135,18 +1174,18 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS -#define __Pyx_GetModuleGlobalName(var, name) {\ +#define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} -#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ +} while(0) +#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} +} while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) @@ -1313,14 +1352,22 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P static int __Pyx_setup_reduce(PyObject* type_obj); /* TypeImport.proto */ -#ifndef __PYX_HAVE_RT_ImportType_proto -#define __PYX_HAVE_RT_ImportType_proto -enum __Pyx_ImportType_CheckSize { - __Pyx_ImportType_CheckSize_Error = 0, - __Pyx_ImportType_CheckSize_Warn = 1, - __Pyx_ImportType_CheckSize_Ignore = 2 +#ifndef __PYX_HAVE_RT_ImportType_proto_0_29_36 +#define __PYX_HAVE_RT_ImportType_proto_0_29_36 +#if __STDC_VERSION__ >= 201112L +#include +#endif +#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L +#define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) alignof(s) +#else +#define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) sizeof(void*) +#endif +enum __Pyx_ImportType_CheckSize_0_29_36 { + __Pyx_ImportType_CheckSize_Error_0_29_36 = 0, + __Pyx_ImportType_CheckSize_Warn_0_29_36 = 1, + __Pyx_ImportType_CheckSize_Ignore_0_29_36 = 2 }; -static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_0_29_36 check_size); #endif /* Import.proto */ @@ -1392,7 +1439,7 @@ static int __Pyx_check_binary_version(void); static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* FunctionImport.proto */ -static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); +static int __Pyx_ImportFunction_0_29_36(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); @@ -4072,7 +4119,7 @@ static PyObject *__pyx_tp_new_4ssh2_5agent_Agent(PyTypeObject *t, PyObject *a, P static void __pyx_tp_dealloc_4ssh2_5agent_Agent(PyObject *o) { struct __pyx_obj_4ssh2_5agent_Agent *p = (struct __pyx_obj_4ssh2_5agent_Agent *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -4187,7 +4234,7 @@ static PyTypeObject __pyx_type_4ssh2_5agent_Agent = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -4307,7 +4354,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { } static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error); + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -4391,15 +4438,12 @@ static int __Pyx_modinit_type_import_code(void) { /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule("ssh2.session"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_4ssh2_7session_Session = __Pyx_ImportType(__pyx_t_1, "ssh2.session", "Session", sizeof(struct __pyx_obj_4ssh2_7session_Session), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_7session_Session) __PYX_ERR(2, 19, __pyx_L1_error) - __pyx_ptype_4ssh2_7session_MethodType = __Pyx_ImportType(__pyx_t_1, "ssh2.session", "MethodType", sizeof(struct __pyx_obj_4ssh2_7session_MethodType), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_7session_MethodType) __PYX_ERR(2, 26, __pyx_L1_error) + __pyx_ptype_4ssh2_7session_Session = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.session", "Session", sizeof(struct __pyx_obj_4ssh2_7session_Session), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_7session_Session),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_7session_Session) __PYX_ERR(2, 19, __pyx_L1_error) + __pyx_ptype_4ssh2_7session_MethodType = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.session", "MethodType", sizeof(struct __pyx_obj_4ssh2_7session_MethodType), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_7session_MethodType),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_7session_MethodType) __PYX_ERR(2, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("ssh2.pkey"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_4ssh2_4pkey_PublicKey = __Pyx_ImportType(__pyx_t_1, "ssh2.pkey", "PublicKey", sizeof(struct __pyx_obj_4ssh2_4pkey_PublicKey), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_4pkey_PublicKey) __PYX_ERR(3, 23, __pyx_L1_error) + __pyx_ptype_4ssh2_4pkey_PublicKey = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.pkey", "PublicKey", sizeof(struct __pyx_obj_4ssh2_4pkey_PublicKey), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_4pkey_PublicKey),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_4pkey_PublicKey) __PYX_ERR(3, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -4427,11 +4471,11 @@ static int __Pyx_modinit_function_import_code(void) { /*--- Function import code ---*/ __pyx_t_1 = PyImport_ImportModule("ssh2.pkey"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_ImportFunction(__pyx_t_1, "PyPublicKey", (void (**)(void))&__pyx_f_4ssh2_4pkey_PyPublicKey, "PyObject *(struct libssh2_agent_publickey *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "PyPublicKey", (void (**)(void))&__pyx_f_4ssh2_4pkey_PyPublicKey, "PyObject *(struct libssh2_agent_publickey *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("ssh2.utils"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_ImportFunction(__pyx_t_1, "to_bytes", (void (**)(void))&__pyx_f_4ssh2_5utils_to_bytes, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "to_bytes", (void (**)(void))&__pyx_f_4ssh2_5utils_to_bytes, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -4608,7 +4652,7 @@ if (!__Pyx_RefNanny) { Py_INCREF(__pyx_b); __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error) Py_INCREF(__pyx_cython_runtime); - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) @@ -5245,17 +5289,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } PyErr_SetObject(type, value); if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - 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 +#if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { @@ -5263,6 +5297,12 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); #endif } bad: @@ -5636,16 +5676,18 @@ static int __Pyx_setup_reduce(PyObject* type_obj) { } /* TypeImport */ -#ifndef __PYX_HAVE_RT_ImportType -#define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, - size_t size, enum __Pyx_ImportType_CheckSize check_size) +#ifndef __PYX_HAVE_RT_ImportType_0_29_36 +#define __PYX_HAVE_RT_ImportType_0_29_36 +static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject *module, const char *module_name, const char *class_name, + size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_0_29_36 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; + Py_ssize_t itemsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; + PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) @@ -5658,6 +5700,7 @@ static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; + itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) @@ -5667,22 +5710,37 @@ static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; + py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); + if (!py_itemsize) + goto bad; + itemsize = PyLong_AsSsize_t(py_itemsize); + Py_DECREF(py_itemsize); + py_itemsize = 0; + if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; #endif - if ((size_t)basicsize < size) { + if (itemsize) { + if (size % alignment) { + alignment = size % alignment; + } + if (itemsize < (Py_ssize_t)alignment) + itemsize = (Py_ssize_t)alignment; + } + if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } - if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + if (check_size == __Pyx_ImportType_CheckSize_Error_0_29_36 && (size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } - else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + else if (check_size == __Pyx_ImportType_CheckSize_Warn_0_29_36 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", @@ -5777,7 +5835,7 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK -static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { +static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON @@ -6162,7 +6220,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -6358,7 +6416,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -6670,9 +6728,9 @@ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *s } /* FunctionImport */ -#ifndef __PYX_HAVE_RT_ImportFunction -#define __PYX_HAVE_RT_ImportFunction -static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { +#ifndef __PYX_HAVE_RT_ImportFunction_0_29_36 +#define __PYX_HAVE_RT_ImportFunction_0_29_36 +static int __Pyx_ImportFunction_0_29_36(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { diff --git a/ssh2/channel.c b/ssh2/channel.c index a10fdccd..3214b958 100644 --- a/ssh2/channel.c +++ b/ssh2/channel.c @@ -1,4 +1,38 @@ -/* Generated by Cython 0.29.32 */ +/* Generated by Cython 0.29.36 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "libssh2/include/libssh2.h", + "libssh2/include/libssh2_sftp.h", + "ssh2/ext/find_eol.h" + ], + "extra_compile_args": [ + "-O2" + ], + "include_dirs": [ + "./ssh2", + "ssh2", + "libssh2/include" + ], + "libraries": [ + "ssh2" + ], + "library_dirs": [ + "/home/jake/Programming/ssh2-python/build_dir/src" + ], + "name": "ssh2.channel", + "runtime_library_dirs": [ + "$ORIGIN/." + ], + "sources": [ + "ssh2/channel.pyx" + ] + }, + "module_name": "ssh2.channel" +} +END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN @@ -9,8 +43,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_32" -#define CYTHON_HEX_VERSION 0x001D20F0 +#define CYTHON_ABI "0_29_36" +#define CYTHON_HEX_VERSION 0x001D24F0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -78,16 +112,20 @@ #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900) + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 @@ -202,8 +240,8 @@ #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) && (PY_VERSION_HEX < 0x030C00A6) - #define CYTHON_USE_PYLONG_INTERNALS 1 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5) #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 @@ -229,7 +267,7 @@ #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 - #elif !defined(CYTHON_FAST_THREAD_STATE) && (PY_VERSION_HEX < 0x030C00A6) + #elif !defined(CYTHON_FAST_THREAD_STATE) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL @@ -242,7 +280,7 @@ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5)) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK @@ -365,9 +403,6 @@ #endif #endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define Py_OptimizeFlag 0 -#endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 @@ -445,6 +480,11 @@ #endif #define __Pyx_DefaultClassType PyType_Type #endif +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif @@ -552,11 +592,11 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 - #if defined(PyUnicode_IS_READY) - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) #else - #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) @@ -565,14 +605,14 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) - #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) - #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) - #endif + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif #endif #else #define CYTHON_PEP393_ENABLED 0 @@ -1237,14 +1277,22 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P static int __Pyx_setup_reduce(PyObject* type_obj); /* TypeImport.proto */ -#ifndef __PYX_HAVE_RT_ImportType_proto -#define __PYX_HAVE_RT_ImportType_proto -enum __Pyx_ImportType_CheckSize { - __Pyx_ImportType_CheckSize_Error = 0, - __Pyx_ImportType_CheckSize_Warn = 1, - __Pyx_ImportType_CheckSize_Ignore = 2 +#ifndef __PYX_HAVE_RT_ImportType_proto_0_29_36 +#define __PYX_HAVE_RT_ImportType_proto_0_29_36 +#if __STDC_VERSION__ >= 201112L +#include +#endif +#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L +#define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) alignof(s) +#else +#define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) sizeof(void*) +#endif +enum __Pyx_ImportType_CheckSize_0_29_36 { + __Pyx_ImportType_CheckSize_Error_0_29_36 = 0, + __Pyx_ImportType_CheckSize_Warn_0_29_36 = 1, + __Pyx_ImportType_CheckSize_Ignore_0_29_36 = 2 }; -static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_0_29_36 check_size); #endif /* Import.proto */ @@ -1348,7 +1396,7 @@ static int __Pyx_check_binary_version(void); static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* FunctionImport.proto */ -static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); +static int __Pyx_ImportFunction_0_29_36(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); @@ -8044,7 +8092,7 @@ static PyObject *__pyx_tp_new_4ssh2_7channel_Channel(PyTypeObject *t, PyObject * static void __pyx_tp_dealloc_4ssh2_7channel_Channel(PyObject *o) { struct __pyx_obj_4ssh2_7channel_Channel *p = (struct __pyx_obj_4ssh2_7channel_Channel *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -8196,7 +8244,7 @@ static PyTypeObject __pyx_type_4ssh2_7channel_Channel = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -8324,7 +8372,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { } static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; @@ -8404,15 +8452,12 @@ static int __Pyx_modinit_type_import_code(void) { /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule("ssh2.session"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_4ssh2_7session_Session = __Pyx_ImportType(__pyx_t_1, "ssh2.session", "Session", sizeof(struct __pyx_obj_4ssh2_7session_Session), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_7session_Session) __PYX_ERR(2, 19, __pyx_L1_error) - __pyx_ptype_4ssh2_7session_MethodType = __Pyx_ImportType(__pyx_t_1, "ssh2.session", "MethodType", sizeof(struct __pyx_obj_4ssh2_7session_MethodType), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_7session_MethodType) __PYX_ERR(2, 26, __pyx_L1_error) + __pyx_ptype_4ssh2_7session_Session = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.session", "Session", sizeof(struct __pyx_obj_4ssh2_7session_Session), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_7session_Session),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_7session_Session) __PYX_ERR(2, 19, __pyx_L1_error) + __pyx_ptype_4ssh2_7session_MethodType = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.session", "MethodType", sizeof(struct __pyx_obj_4ssh2_7session_MethodType), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_7session_MethodType),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_7session_MethodType) __PYX_ERR(2, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("ssh2.sftp"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_4ssh2_4sftp_SFTP = __Pyx_ImportType(__pyx_t_1, "ssh2.sftp", "SFTP", sizeof(struct __pyx_obj_4ssh2_4sftp_SFTP), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_4sftp_SFTP) __PYX_ERR(3, 26, __pyx_L1_error) + __pyx_ptype_4ssh2_4sftp_SFTP = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.sftp", "SFTP", sizeof(struct __pyx_obj_4ssh2_4sftp_SFTP), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_4sftp_SFTP),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_4sftp_SFTP) __PYX_ERR(3, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -8440,8 +8485,8 @@ static int __Pyx_modinit_function_import_code(void) { /*--- Function import code ---*/ __pyx_t_1 = PyImport_ImportModule("ssh2.utils"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_ImportFunction(__pyx_t_1, "to_bytes", (void (**)(void))&__pyx_f_4ssh2_5utils_to_bytes, "PyObject *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportFunction(__pyx_t_1, "handle_error_codes", (void (**)(void))&__pyx_f_4ssh2_5utils_handle_error_codes, "int (int, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "to_bytes", (void (**)(void))&__pyx_f_4ssh2_5utils_to_bytes, "PyObject *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "handle_error_codes", (void (**)(void))&__pyx_f_4ssh2_5utils_handle_error_codes, "int (int, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -8618,7 +8663,7 @@ if (!__Pyx_RefNanny) { Py_INCREF(__pyx_b); __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_cython_runtime); - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) @@ -9263,17 +9308,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } PyErr_SetObject(type, value); if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - 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 +#if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { @@ -9281,6 +9316,12 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); #endif } bad: @@ -9491,16 +9532,18 @@ static int __Pyx_setup_reduce(PyObject* type_obj) { } /* TypeImport */ -#ifndef __PYX_HAVE_RT_ImportType -#define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, - size_t size, enum __Pyx_ImportType_CheckSize check_size) +#ifndef __PYX_HAVE_RT_ImportType_0_29_36 +#define __PYX_HAVE_RT_ImportType_0_29_36 +static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject *module, const char *module_name, const char *class_name, + size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_0_29_36 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; + Py_ssize_t itemsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; + PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) @@ -9513,6 +9556,7 @@ static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; + itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) @@ -9522,22 +9566,37 @@ static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; + py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); + if (!py_itemsize) + goto bad; + itemsize = PyLong_AsSsize_t(py_itemsize); + Py_DECREF(py_itemsize); + py_itemsize = 0; + if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; #endif - if ((size_t)basicsize < size) { + if (itemsize) { + if (size % alignment) { + alignment = size % alignment; + } + if (itemsize < (Py_ssize_t)alignment) + itemsize = (Py_ssize_t)alignment; + } + if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } - if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + if (check_size == __Pyx_ImportType_CheckSize_Error_0_29_36 && (size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } - else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + else if (check_size == __Pyx_ImportType_CheckSize_Warn_0_29_36 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", @@ -9658,7 +9717,7 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK -static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { +static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON @@ -9967,7 +10026,7 @@ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -10163,7 +10222,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -10359,7 +10418,7 @@ static CYTHON_INLINE unsigned long __Pyx_PyInt_As_unsigned_long(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -10631,7 +10690,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -10943,9 +11002,9 @@ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *s } /* FunctionImport */ -#ifndef __PYX_HAVE_RT_ImportFunction -#define __PYX_HAVE_RT_ImportFunction -static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { +#ifndef __PYX_HAVE_RT_ImportFunction_0_29_36 +#define __PYX_HAVE_RT_ImportFunction_0_29_36 +static int __Pyx_ImportFunction_0_29_36(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { diff --git a/ssh2/error_codes.c b/ssh2/error_codes.c index fa16e008..1cb5b484 100644 --- a/ssh2/error_codes.c +++ b/ssh2/error_codes.c @@ -1,4 +1,34 @@ -/* Generated by Cython 0.29.32 */ +/* Generated by Cython 0.29.36 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "libssh2/include/libssh2.h" + ], + "extra_compile_args": [ + "-O2" + ], + "include_dirs": [ + "libssh2/include" + ], + "libraries": [ + "ssh2" + ], + "library_dirs": [ + "/home/jake/Programming/ssh2-python/build_dir/src" + ], + "name": "ssh2.error_codes", + "runtime_library_dirs": [ + "$ORIGIN/." + ], + "sources": [ + "ssh2/error_codes.pyx" + ] + }, + "module_name": "ssh2.error_codes" +} +END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN @@ -9,8 +39,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_32" -#define CYTHON_HEX_VERSION 0x001D20F0 +#define CYTHON_ABI "0_29_36" +#define CYTHON_HEX_VERSION 0x001D24F0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -78,16 +108,20 @@ #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900) + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 @@ -202,8 +236,8 @@ #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) && (PY_VERSION_HEX < 0x030C00A6) - #define CYTHON_USE_PYLONG_INTERNALS 1 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5) #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 @@ -229,7 +263,7 @@ #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 - #elif !defined(CYTHON_FAST_THREAD_STATE) && (PY_VERSION_HEX < 0x030C00A6) + #elif !defined(CYTHON_FAST_THREAD_STATE) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL @@ -242,7 +276,7 @@ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5)) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK @@ -365,9 +399,6 @@ #endif #endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define Py_OptimizeFlag 0 -#endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 @@ -445,6 +476,11 @@ #endif #define __Pyx_DefaultClassType PyType_Type #endif +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif @@ -552,11 +588,11 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 - #if defined(PyUnicode_IS_READY) - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) #else - #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) @@ -565,14 +601,14 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) - #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) - #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) - #endif + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif #endif #else #define CYTHON_PEP393_ENABLED 0 @@ -1396,7 +1432,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { } static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -1632,7 +1668,7 @@ if (!__Pyx_RefNanny) { Py_INCREF(__pyx_b); __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_cython_runtime); - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) @@ -2394,7 +2430,7 @@ static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK -static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { +static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON @@ -2779,7 +2815,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -2975,7 +3011,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } diff --git a/ssh2/fileinfo.c b/ssh2/fileinfo.c index 7e262de9..21d7ca55 100644 --- a/ssh2/fileinfo.c +++ b/ssh2/fileinfo.c @@ -1,4 +1,34 @@ -/* Generated by Cython 0.29.32 */ +/* Generated by Cython 0.29.36 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "libssh2/include/libssh2.h" + ], + "extra_compile_args": [ + "-O2" + ], + "include_dirs": [ + "libssh2/include" + ], + "libraries": [ + "ssh2" + ], + "library_dirs": [ + "/home/jake/Programming/ssh2-python/build_dir/src" + ], + "name": "ssh2.fileinfo", + "runtime_library_dirs": [ + "$ORIGIN/." + ], + "sources": [ + "ssh2/fileinfo.pyx" + ] + }, + "module_name": "ssh2.fileinfo" +} +END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN @@ -9,8 +39,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_32" -#define CYTHON_HEX_VERSION 0x001D20F0 +#define CYTHON_ABI "0_29_36" +#define CYTHON_HEX_VERSION 0x001D24F0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -78,16 +108,20 @@ #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900) + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 @@ -202,8 +236,8 @@ #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) && (PY_VERSION_HEX < 0x030C00A6) - #define CYTHON_USE_PYLONG_INTERNALS 1 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5) #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 @@ -229,7 +263,7 @@ #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 - #elif !defined(CYTHON_FAST_THREAD_STATE) && (PY_VERSION_HEX < 0x030C00A6) + #elif !defined(CYTHON_FAST_THREAD_STATE) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL @@ -242,7 +276,7 @@ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5)) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK @@ -365,9 +399,6 @@ #endif #endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define Py_OptimizeFlag 0 -#endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 @@ -445,6 +476,11 @@ #endif #define __Pyx_DefaultClassType PyType_Type #endif +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif @@ -552,11 +588,11 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 - #if defined(PyUnicode_IS_READY) - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) #else - #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) @@ -565,14 +601,14 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) - #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) - #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) - #endif + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif #endif #else #define CYTHON_PEP393_ENABLED 0 @@ -2314,7 +2350,7 @@ static PyObject *__pyx_tp_new_4ssh2_8fileinfo_FileInfo(PyTypeObject *t, CYTHON_U static void __pyx_tp_dealloc_4ssh2_8fileinfo_FileInfo(PyObject *o) { #if CYTHON_USE_TP_FINALIZE - if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -2466,7 +2502,7 @@ static PyTypeObject __pyx_type_4ssh2_8fileinfo_FileInfo = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -2571,7 +2607,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { } static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -2823,7 +2859,7 @@ if (!__Pyx_RefNanny) { Py_INCREF(__pyx_b); __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_cython_runtime); - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) @@ -3184,17 +3220,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } PyErr_SetObject(type, value); if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - 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 +#if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { @@ -3202,6 +3228,12 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); #endif } bad: @@ -3439,7 +3471,7 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK -static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { +static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON @@ -3900,7 +3932,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -4096,7 +4128,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } diff --git a/ssh2/knownhost.c b/ssh2/knownhost.c index a15af191..3c8b9c39 100644 --- a/ssh2/knownhost.c +++ b/ssh2/knownhost.c @@ -1,4 +1,37 @@ -/* Generated by Cython 0.29.32 */ +/* Generated by Cython 0.29.36 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "libssh2/include/libssh2.h", + "ssh2/ext/find_eol.h" + ], + "extra_compile_args": [ + "-O2" + ], + "include_dirs": [ + "./ssh2", + "ssh2", + "libssh2/include" + ], + "libraries": [ + "ssh2" + ], + "library_dirs": [ + "/home/jake/Programming/ssh2-python/build_dir/src" + ], + "name": "ssh2.knownhost", + "runtime_library_dirs": [ + "$ORIGIN/." + ], + "sources": [ + "ssh2/knownhost.pyx" + ] + }, + "module_name": "ssh2.knownhost" +} +END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN @@ -9,8 +42,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_32" -#define CYTHON_HEX_VERSION 0x001D20F0 +#define CYTHON_ABI "0_29_36" +#define CYTHON_HEX_VERSION 0x001D24F0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -78,16 +111,20 @@ #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900) + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 @@ -202,8 +239,8 @@ #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) && (PY_VERSION_HEX < 0x030C00A6) - #define CYTHON_USE_PYLONG_INTERNALS 1 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5) #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 @@ -229,7 +266,7 @@ #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 - #elif !defined(CYTHON_FAST_THREAD_STATE) && (PY_VERSION_HEX < 0x030C00A6) + #elif !defined(CYTHON_FAST_THREAD_STATE) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL @@ -242,7 +279,7 @@ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5)) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK @@ -365,9 +402,6 @@ #endif #endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define Py_OptimizeFlag 0 -#endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 @@ -445,6 +479,11 @@ #endif #define __Pyx_DefaultClassType PyType_Type #endif +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif @@ -552,11 +591,11 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 - #if defined(PyUnicode_IS_READY) - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) #else - #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) @@ -565,14 +604,14 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) - #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) - #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) - #endif + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif #endif #else #define CYTHON_PEP393_ENABLED 0 @@ -1197,18 +1236,18 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS -#define __Pyx_GetModuleGlobalName(var, name) {\ +#define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} -#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ +} while(0) +#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} +} while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) @@ -1354,14 +1393,22 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P static int __Pyx_setup_reduce(PyObject* type_obj); /* TypeImport.proto */ -#ifndef __PYX_HAVE_RT_ImportType_proto -#define __PYX_HAVE_RT_ImportType_proto -enum __Pyx_ImportType_CheckSize { - __Pyx_ImportType_CheckSize_Error = 0, - __Pyx_ImportType_CheckSize_Warn = 1, - __Pyx_ImportType_CheckSize_Ignore = 2 +#ifndef __PYX_HAVE_RT_ImportType_proto_0_29_36 +#define __PYX_HAVE_RT_ImportType_proto_0_29_36 +#if __STDC_VERSION__ >= 201112L +#include +#endif +#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L +#define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) alignof(s) +#else +#define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) sizeof(void*) +#endif +enum __Pyx_ImportType_CheckSize_0_29_36 { + __Pyx_ImportType_CheckSize_Error_0_29_36 = 0, + __Pyx_ImportType_CheckSize_Warn_0_29_36 = 1, + __Pyx_ImportType_CheckSize_Ignore_0_29_36 = 2 }; -static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_0_29_36 check_size); #endif /* Import.proto */ @@ -1439,7 +1486,7 @@ static int __Pyx_check_binary_version(void); static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* FunctionImport.proto */ -static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); +static int __Pyx_ImportFunction_0_29_36(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); @@ -6433,7 +6480,7 @@ static PyObject *__pyx_tp_new_4ssh2_9knownhost_KnownHostEntry(PyTypeObject *t, C static void __pyx_tp_dealloc_4ssh2_9knownhost_KnownHostEntry(PyObject *o) { #if CYTHON_USE_TP_FINALIZE - if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -6538,7 +6585,7 @@ static PyTypeObject __pyx_type_4ssh2_9knownhost_KnownHostEntry = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -6564,7 +6611,7 @@ static PyObject *__pyx_tp_new_4ssh2_9knownhost_KnownHost(PyTypeObject *t, PyObje static void __pyx_tp_dealloc_4ssh2_9knownhost_KnownHost(PyObject *o) { struct __pyx_obj_4ssh2_9knownhost_KnownHost *p = (struct __pyx_obj_4ssh2_9knownhost_KnownHost *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -6682,7 +6729,7 @@ static PyTypeObject __pyx_type_4ssh2_9knownhost_KnownHost = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -6872,7 +6919,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { } static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -6961,10 +7008,8 @@ static int __Pyx_modinit_type_import_code(void) { /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule("ssh2.session"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_4ssh2_7session_Session = __Pyx_ImportType(__pyx_t_1, "ssh2.session", "Session", sizeof(struct __pyx_obj_4ssh2_7session_Session), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_7session_Session) __PYX_ERR(2, 19, __pyx_L1_error) - __pyx_ptype_4ssh2_7session_MethodType = __Pyx_ImportType(__pyx_t_1, "ssh2.session", "MethodType", sizeof(struct __pyx_obj_4ssh2_7session_MethodType), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_7session_MethodType) __PYX_ERR(2, 26, __pyx_L1_error) + __pyx_ptype_4ssh2_7session_Session = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.session", "Session", sizeof(struct __pyx_obj_4ssh2_7session_Session), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_7session_Session),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_7session_Session) __PYX_ERR(2, 19, __pyx_L1_error) + __pyx_ptype_4ssh2_7session_MethodType = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.session", "MethodType", sizeof(struct __pyx_obj_4ssh2_7session_MethodType), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_7session_MethodType),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_7session_MethodType) __PYX_ERR(2, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -6992,7 +7037,7 @@ static int __Pyx_modinit_function_import_code(void) { /*--- Function import code ---*/ __pyx_t_1 = PyImport_ImportModule("ssh2.utils"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_ImportFunction(__pyx_t_1, "to_bytes", (void (**)(void))&__pyx_f_4ssh2_5utils_to_bytes, "PyObject *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "to_bytes", (void (**)(void))&__pyx_f_4ssh2_5utils_to_bytes, "PyObject *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -7169,7 +7214,7 @@ if (!__Pyx_RefNanny) { Py_INCREF(__pyx_b); __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_cython_runtime); - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) @@ -7810,7 +7855,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { return __Pyx_PyFunction_FastCall(func, NULL, 0); } #endif -#ifdef __Pyx_CyFunction_USED +#if defined(__Pyx_CyFunction_USED) && defined(NDEBUG) if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) #else if (likely(PyCFunction_Check(func))) @@ -8138,17 +8183,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } PyErr_SetObject(type, value); if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - 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 +#if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { @@ -8156,6 +8191,12 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); #endif } bad: @@ -8694,16 +8735,18 @@ static int __Pyx_setup_reduce(PyObject* type_obj) { } /* TypeImport */ -#ifndef __PYX_HAVE_RT_ImportType -#define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, - size_t size, enum __Pyx_ImportType_CheckSize check_size) +#ifndef __PYX_HAVE_RT_ImportType_0_29_36 +#define __PYX_HAVE_RT_ImportType_0_29_36 +static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject *module, const char *module_name, const char *class_name, + size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_0_29_36 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; + Py_ssize_t itemsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; + PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) @@ -8716,6 +8759,7 @@ static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; + itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) @@ -8725,22 +8769,37 @@ static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; + py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); + if (!py_itemsize) + goto bad; + itemsize = PyLong_AsSsize_t(py_itemsize); + Py_DECREF(py_itemsize); + py_itemsize = 0; + if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; #endif - if ((size_t)basicsize < size) { + if (itemsize) { + if (size % alignment) { + alignment = size % alignment; + } + if (itemsize < (Py_ssize_t)alignment) + itemsize = (Py_ssize_t)alignment; + } + if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } - if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + if (check_size == __Pyx_ImportType_CheckSize_Error_0_29_36 && (size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } - else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + else if (check_size == __Pyx_ImportType_CheckSize_Warn_0_29_36 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", @@ -8835,7 +8894,7 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK -static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { +static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON @@ -9182,7 +9241,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -9378,7 +9437,7 @@ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -9650,7 +9709,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -9962,9 +10021,9 @@ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *s } /* FunctionImport */ -#ifndef __PYX_HAVE_RT_ImportFunction -#define __PYX_HAVE_RT_ImportFunction -static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { +#ifndef __PYX_HAVE_RT_ImportFunction_0_29_36 +#define __PYX_HAVE_RT_ImportFunction_0_29_36 +static int __Pyx_ImportFunction_0_29_36(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { diff --git a/ssh2/listener.c b/ssh2/listener.c index f40efe40..4faef67e 100644 --- a/ssh2/listener.c +++ b/ssh2/listener.c @@ -1,4 +1,36 @@ -/* Generated by Cython 0.29.32 */ +/* Generated by Cython 0.29.36 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "libssh2/include/libssh2.h", + "ssh2/ext/find_eol.h" + ], + "extra_compile_args": [ + "-O2" + ], + "include_dirs": [ + "./ssh2", + "libssh2/include" + ], + "libraries": [ + "ssh2" + ], + "library_dirs": [ + "/home/jake/Programming/ssh2-python/build_dir/src" + ], + "name": "ssh2.listener", + "runtime_library_dirs": [ + "$ORIGIN/." + ], + "sources": [ + "ssh2/listener.pyx" + ] + }, + "module_name": "ssh2.listener" +} +END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN @@ -9,8 +41,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_32" -#define CYTHON_HEX_VERSION 0x001D20F0 +#define CYTHON_ABI "0_29_36" +#define CYTHON_HEX_VERSION 0x001D24F0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -78,16 +110,20 @@ #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900) + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 @@ -202,8 +238,8 @@ #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) && (PY_VERSION_HEX < 0x030C00A6) - #define CYTHON_USE_PYLONG_INTERNALS 1 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5) #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 @@ -229,7 +265,7 @@ #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 - #elif !defined(CYTHON_FAST_THREAD_STATE) && (PY_VERSION_HEX < 0x030C00A6) + #elif !defined(CYTHON_FAST_THREAD_STATE) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL @@ -242,7 +278,7 @@ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5)) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK @@ -365,9 +401,6 @@ #endif #endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define Py_OptimizeFlag 0 -#endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 @@ -445,6 +478,11 @@ #endif #define __Pyx_DefaultClassType PyType_Type #endif +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif @@ -552,11 +590,11 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 - #if defined(PyUnicode_IS_READY) - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) #else - #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) @@ -565,14 +603,14 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) - #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) - #endif - #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif #endif #else #define CYTHON_PEP393_ENABLED 0 @@ -1199,14 +1237,22 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P static int __Pyx_setup_reduce(PyObject* type_obj); /* TypeImport.proto */ -#ifndef __PYX_HAVE_RT_ImportType_proto -#define __PYX_HAVE_RT_ImportType_proto -enum __Pyx_ImportType_CheckSize { - __Pyx_ImportType_CheckSize_Error = 0, - __Pyx_ImportType_CheckSize_Warn = 1, - __Pyx_ImportType_CheckSize_Ignore = 2 +#ifndef __PYX_HAVE_RT_ImportType_proto_0_29_36 +#define __PYX_HAVE_RT_ImportType_proto_0_29_36 +#if __STDC_VERSION__ >= 201112L +#include +#endif +#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L +#define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) alignof(s) +#else +#define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) sizeof(void*) +#endif +enum __Pyx_ImportType_CheckSize_0_29_36 { + __Pyx_ImportType_CheckSize_Error_0_29_36 = 0, + __Pyx_ImportType_CheckSize_Warn_0_29_36 = 1, + __Pyx_ImportType_CheckSize_Ignore_0_29_36 = 2 }; -static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_0_29_36 check_size); #endif /* PyDictVersioning.proto */ @@ -1298,7 +1344,7 @@ static int __Pyx_check_binary_version(void); static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* FunctionImport.proto */ -static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); +static int __Pyx_ImportFunction_0_29_36(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); @@ -1974,7 +2020,7 @@ static PyObject *__pyx_tp_new_4ssh2_8listener_Listener(PyTypeObject *t, PyObject static void __pyx_tp_dealloc_4ssh2_8listener_Listener(PyObject *o) { struct __pyx_obj_4ssh2_8listener_Listener *p = (struct __pyx_obj_4ssh2_8listener_Listener *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -2076,7 +2122,7 @@ static PyTypeObject __pyx_type_4ssh2_8listener_Listener = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -2180,7 +2226,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { } static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error); + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -2259,15 +2305,12 @@ static int __Pyx_modinit_type_import_code(void) { /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule("ssh2.session"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_4ssh2_7session_Session = __Pyx_ImportType(__pyx_t_1, "ssh2.session", "Session", sizeof(struct __pyx_obj_4ssh2_7session_Session), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_7session_Session) __PYX_ERR(2, 19, __pyx_L1_error) - __pyx_ptype_4ssh2_7session_MethodType = __Pyx_ImportType(__pyx_t_1, "ssh2.session", "MethodType", sizeof(struct __pyx_obj_4ssh2_7session_MethodType), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_7session_MethodType) __PYX_ERR(2, 26, __pyx_L1_error) + __pyx_ptype_4ssh2_7session_Session = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.session", "Session", sizeof(struct __pyx_obj_4ssh2_7session_Session), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_7session_Session),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_7session_Session) __PYX_ERR(2, 19, __pyx_L1_error) + __pyx_ptype_4ssh2_7session_MethodType = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.session", "MethodType", sizeof(struct __pyx_obj_4ssh2_7session_MethodType), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_7session_MethodType),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_7session_MethodType) __PYX_ERR(2, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("ssh2.channel"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_4ssh2_7channel_Channel = __Pyx_ImportType(__pyx_t_1, "ssh2.channel", "Channel", sizeof(struct __pyx_obj_4ssh2_7channel_Channel), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_7channel_Channel) __PYX_ERR(3, 24, __pyx_L1_error) + __pyx_ptype_4ssh2_7channel_Channel = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.channel", "Channel", sizeof(struct __pyx_obj_4ssh2_7channel_Channel), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_7channel_Channel),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_7channel_Channel) __PYX_ERR(3, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -2295,11 +2338,11 @@ static int __Pyx_modinit_function_import_code(void) { /*--- Function import code ---*/ __pyx_t_1 = PyImport_ImportModule("ssh2.channel"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_ImportFunction(__pyx_t_1, "PyChannel", (void (**)(void))&__pyx_f_4ssh2_7channel_PyChannel, "PyObject *(LIBSSH2_CHANNEL *, struct __pyx_obj_4ssh2_7session_Session *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "PyChannel", (void (**)(void))&__pyx_f_4ssh2_7channel_PyChannel, "PyObject *(LIBSSH2_CHANNEL *, struct __pyx_obj_4ssh2_7session_Session *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("ssh2.utils"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_ImportFunction(__pyx_t_1, "handle_error_codes", (void (**)(void))&__pyx_f_4ssh2_5utils_handle_error_codes, "int (int, int __pyx_skip_dispatch)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "handle_error_codes", (void (**)(void))&__pyx_f_4ssh2_5utils_handle_error_codes, "int (int, int __pyx_skip_dispatch)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -2475,7 +2518,7 @@ if (!__Pyx_RefNanny) { Py_INCREF(__pyx_b); __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error) Py_INCREF(__pyx_cython_runtime); - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) @@ -2925,17 +2968,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } PyErr_SetObject(type, value); if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - 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 +#if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { @@ -2943,6 +2976,12 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); #endif } bad: @@ -3153,16 +3192,18 @@ static int __Pyx_setup_reduce(PyObject* type_obj) { } /* TypeImport */ -#ifndef __PYX_HAVE_RT_ImportType -#define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, - size_t size, enum __Pyx_ImportType_CheckSize check_size) +#ifndef __PYX_HAVE_RT_ImportType_0_29_36 +#define __PYX_HAVE_RT_ImportType_0_29_36 +static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject *module, const char *module_name, const char *class_name, + size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_0_29_36 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; + Py_ssize_t itemsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; + PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) @@ -3175,6 +3216,7 @@ static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; + itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) @@ -3184,22 +3226,37 @@ static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; + py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); + if (!py_itemsize) + goto bad; + itemsize = PyLong_AsSsize_t(py_itemsize); + Py_DECREF(py_itemsize); + py_itemsize = 0; + if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; #endif - if ((size_t)basicsize < size) { + if (itemsize) { + if (size % alignment) { + alignment = size % alignment; + } + if (itemsize < (Py_ssize_t)alignment) + itemsize = (Py_ssize_t)alignment; + } + if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } - if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + if (check_size == __Pyx_ImportType_CheckSize_Error_0_29_36 && (size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } - else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + else if (check_size == __Pyx_ImportType_CheckSize_Warn_0_29_36 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", @@ -3241,7 +3298,7 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK -static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { +static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON @@ -3626,7 +3683,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -3822,7 +3879,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -4134,9 +4191,9 @@ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *s } /* FunctionImport */ -#ifndef __PYX_HAVE_RT_ImportFunction -#define __PYX_HAVE_RT_ImportFunction -static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { +#ifndef __PYX_HAVE_RT_ImportFunction_0_29_36 +#define __PYX_HAVE_RT_ImportFunction_0_29_36 +static int __Pyx_ImportFunction_0_29_36(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { diff --git a/ssh2/pkey.c b/ssh2/pkey.c index f6b1a559..d9b56537 100644 --- a/ssh2/pkey.c +++ b/ssh2/pkey.c @@ -1,4 +1,34 @@ -/* Generated by Cython 0.29.32 */ +/* Generated by Cython 0.29.36 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "libssh2/include/libssh2.h" + ], + "extra_compile_args": [ + "-O2" + ], + "include_dirs": [ + "libssh2/include" + ], + "libraries": [ + "ssh2" + ], + "library_dirs": [ + "/home/jake/Programming/ssh2-python/build_dir/src" + ], + "name": "ssh2.pkey", + "runtime_library_dirs": [ + "$ORIGIN/." + ], + "sources": [ + "ssh2/pkey.pyx" + ] + }, + "module_name": "ssh2.pkey" +} +END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN @@ -9,8 +39,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_32" -#define CYTHON_HEX_VERSION 0x001D20F0 +#define CYTHON_ABI "0_29_36" +#define CYTHON_HEX_VERSION 0x001D24F0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -78,16 +108,20 @@ #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900) + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 @@ -202,8 +236,8 @@ #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) && (PY_VERSION_HEX < 0x030C00A6) - #define CYTHON_USE_PYLONG_INTERNALS 1 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5) #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 @@ -229,7 +263,7 @@ #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 - #elif !defined(CYTHON_FAST_THREAD_STATE) && (PY_VERSION_HEX < 0x030C00A6) + #elif !defined(CYTHON_FAST_THREAD_STATE) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL @@ -242,7 +276,7 @@ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5)) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK @@ -365,9 +399,6 @@ #endif #endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define Py_OptimizeFlag 0 -#endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 @@ -445,6 +476,11 @@ #endif #define __Pyx_DefaultClassType PyType_Type #endif +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif @@ -552,11 +588,11 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 - #if defined(PyUnicode_IS_READY) - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) #else - #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) @@ -565,14 +601,14 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) - #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) - #endif - #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif #endif #else #define CYTHON_PEP393_ENABLED 0 @@ -1902,7 +1938,7 @@ static PyObject *__pyx_tp_new_4ssh2_4pkey_PublicKey(PyTypeObject *t, CYTHON_UNUS static void __pyx_tp_dealloc_4ssh2_4pkey_PublicKey(PyObject *o) { #if CYTHON_USE_TP_FINALIZE - if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -2006,7 +2042,7 @@ static PyTypeObject __pyx_type_4ssh2_4pkey_PublicKey = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -2109,7 +2145,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { } static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error); + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -2368,7 +2404,7 @@ if (!__Pyx_RefNanny) { Py_INCREF(__pyx_b); __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error) Py_INCREF(__pyx_cython_runtime); - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) @@ -2729,17 +2765,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } PyErr_SetObject(type, value); if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - 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 +#if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { @@ -2747,6 +2773,12 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); #endif } bad: @@ -2984,7 +3016,7 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK -static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { +static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON @@ -3369,7 +3401,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -3565,7 +3597,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } diff --git a/ssh2/publickey.c b/ssh2/publickey.c index 92f901d2..98e9716c 100644 --- a/ssh2/publickey.c +++ b/ssh2/publickey.c @@ -1,4 +1,38 @@ -/* Generated by Cython 0.29.32 */ +/* Generated by Cython 0.29.36 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "libssh2/include/libssh2.h", + "libssh2/include/libssh2_publickey.h", + "ssh2/ext/find_eol.h" + ], + "extra_compile_args": [ + "-O2" + ], + "include_dirs": [ + "./ssh2", + "ssh2", + "libssh2/include" + ], + "libraries": [ + "ssh2" + ], + "library_dirs": [ + "/home/jake/Programming/ssh2-python/build_dir/src" + ], + "name": "ssh2.publickey", + "runtime_library_dirs": [ + "$ORIGIN/." + ], + "sources": [ + "ssh2/publickey.pyx" + ] + }, + "module_name": "ssh2.publickey" +} +END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN @@ -9,8 +43,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_32" -#define CYTHON_HEX_VERSION 0x001D20F0 +#define CYTHON_ABI "0_29_36" +#define CYTHON_HEX_VERSION 0x001D24F0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -78,16 +112,20 @@ #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900) + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 @@ -202,8 +240,8 @@ #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) && (PY_VERSION_HEX < 0x030C00A6) - #define CYTHON_USE_PYLONG_INTERNALS 1 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5) #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 @@ -229,7 +267,7 @@ #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 - #elif !defined(CYTHON_FAST_THREAD_STATE) && (PY_VERSION_HEX < 0x030C00A6) + #elif !defined(CYTHON_FAST_THREAD_STATE) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL @@ -242,7 +280,7 @@ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5)) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK @@ -365,9 +403,6 @@ #endif #endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define Py_OptimizeFlag 0 -#endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 @@ -445,6 +480,11 @@ #endif #define __Pyx_DefaultClassType PyType_Type #endif +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif @@ -552,11 +592,11 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 - #if defined(PyUnicode_IS_READY) - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) #else - #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) @@ -565,14 +605,14 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) - #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) - #endif - #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif #endif #else #define CYTHON_PEP393_ENABLED 0 @@ -1275,14 +1315,22 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P static int __Pyx_setup_reduce(PyObject* type_obj); /* TypeImport.proto */ -#ifndef __PYX_HAVE_RT_ImportType_proto -#define __PYX_HAVE_RT_ImportType_proto -enum __Pyx_ImportType_CheckSize { - __Pyx_ImportType_CheckSize_Error = 0, - __Pyx_ImportType_CheckSize_Warn = 1, - __Pyx_ImportType_CheckSize_Ignore = 2 +#ifndef __PYX_HAVE_RT_ImportType_proto_0_29_36 +#define __PYX_HAVE_RT_ImportType_proto_0_29_36 +#if __STDC_VERSION__ >= 201112L +#include +#endif +#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L +#define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) alignof(s) +#else +#define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) sizeof(void*) +#endif +enum __Pyx_ImportType_CheckSize_0_29_36 { + __Pyx_ImportType_CheckSize_Error_0_29_36 = 0, + __Pyx_ImportType_CheckSize_Warn_0_29_36 = 1, + __Pyx_ImportType_CheckSize_Ignore_0_29_36 = 2 }; -static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_0_29_36 check_size); #endif /* PyDictVersioning.proto */ @@ -1389,7 +1437,7 @@ static int __Pyx_check_binary_version(void); static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* FunctionImport.proto */ -static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); +static int __Pyx_ImportFunction_0_29_36(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); @@ -5127,7 +5175,7 @@ static PyObject *__pyx_tp_new_4ssh2_9publickey_PublicKeyList(PyTypeObject *t, Py static void __pyx_tp_dealloc_4ssh2_9publickey_PublicKeyList(PyObject *o) { struct __pyx_obj_4ssh2_9publickey_PublicKeyList *p = (struct __pyx_obj_4ssh2_9publickey_PublicKeyList *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -5264,7 +5312,7 @@ static PyTypeObject __pyx_type_4ssh2_9publickey_PublicKeyList = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -5286,7 +5334,7 @@ static PyObject *__pyx_tp_new_4ssh2_9publickey_PublicKeyAttribute(PyTypeObject * static void __pyx_tp_dealloc_4ssh2_9publickey_PublicKeyAttribute(PyObject *o) { #if CYTHON_USE_TP_FINALIZE - if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -5395,7 +5443,7 @@ static PyTypeObject __pyx_type_4ssh2_9publickey_PublicKeyAttribute = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -5421,7 +5469,7 @@ static PyObject *__pyx_tp_new_4ssh2_9publickey_PublicKeySystem(PyTypeObject *t, static void __pyx_tp_dealloc_4ssh2_9publickey_PublicKeySystem(PyObject *o) { struct __pyx_obj_4ssh2_9publickey_PublicKeySystem *p = (struct __pyx_obj_4ssh2_9publickey_PublicKeySystem *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -5534,7 +5582,7 @@ static PyTypeObject __pyx_type_4ssh2_9publickey_PublicKeySystem = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -5758,7 +5806,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { } static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error); + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -5858,10 +5906,8 @@ static int __Pyx_modinit_type_import_code(void) { /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule("ssh2.session"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_4ssh2_7session_Session = __Pyx_ImportType(__pyx_t_1, "ssh2.session", "Session", sizeof(struct __pyx_obj_4ssh2_7session_Session), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_7session_Session) __PYX_ERR(2, 19, __pyx_L1_error) - __pyx_ptype_4ssh2_7session_MethodType = __Pyx_ImportType(__pyx_t_1, "ssh2.session", "MethodType", sizeof(struct __pyx_obj_4ssh2_7session_MethodType), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_7session_MethodType) __PYX_ERR(2, 26, __pyx_L1_error) + __pyx_ptype_4ssh2_7session_Session = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.session", "Session", sizeof(struct __pyx_obj_4ssh2_7session_Session), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_7session_Session),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_7session_Session) __PYX_ERR(2, 19, __pyx_L1_error) + __pyx_ptype_4ssh2_7session_MethodType = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.session", "MethodType", sizeof(struct __pyx_obj_4ssh2_7session_MethodType), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_7session_MethodType),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_7session_MethodType) __PYX_ERR(2, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -5889,8 +5935,8 @@ static int __Pyx_modinit_function_import_code(void) { /*--- Function import code ---*/ __pyx_t_1 = PyImport_ImportModule("ssh2.utils"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_ImportFunction(__pyx_t_1, "to_bytes", (void (**)(void))&__pyx_f_4ssh2_5utils_to_bytes, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) - if (__Pyx_ImportFunction(__pyx_t_1, "handle_error_codes", (void (**)(void))&__pyx_f_4ssh2_5utils_handle_error_codes, "int (int, int __pyx_skip_dispatch)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "to_bytes", (void (**)(void))&__pyx_f_4ssh2_5utils_to_bytes, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "handle_error_codes", (void (**)(void))&__pyx_f_4ssh2_5utils_handle_error_codes, "int (int, int __pyx_skip_dispatch)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -6066,7 +6112,7 @@ if (!__Pyx_RefNanny) { Py_INCREF(__pyx_b); __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error) Py_INCREF(__pyx_cython_runtime); - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) @@ -6532,17 +6578,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } PyErr_SetObject(type, value); if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - 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 +#if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { @@ -6550,6 +6586,12 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); #endif } bad: @@ -6569,9 +6611,7 @@ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, PyGILState_STATE state; if (nogil) state = PyGILState_Ensure(); -#ifdef _MSC_VER - else state = (PyGILState_STATE)-1; -#endif + else state = (PyGILState_STATE)0; #endif __Pyx_PyThreadState_assign __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); @@ -6956,16 +6996,18 @@ static int __Pyx_setup_reduce(PyObject* type_obj) { } /* TypeImport */ -#ifndef __PYX_HAVE_RT_ImportType -#define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, - size_t size, enum __Pyx_ImportType_CheckSize check_size) +#ifndef __PYX_HAVE_RT_ImportType_0_29_36 +#define __PYX_HAVE_RT_ImportType_0_29_36 +static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject *module, const char *module_name, const char *class_name, + size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_0_29_36 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; + Py_ssize_t itemsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; + PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) @@ -6978,6 +7020,7 @@ static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; + itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) @@ -6987,22 +7030,37 @@ static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; + py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); + if (!py_itemsize) + goto bad; + itemsize = PyLong_AsSsize_t(py_itemsize); + Py_DECREF(py_itemsize); + py_itemsize = 0; + if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; #endif - if ((size_t)basicsize < size) { + if (itemsize) { + if (size % alignment) { + alignment = size % alignment; + } + if (itemsize < (Py_ssize_t)alignment) + itemsize = (Py_ssize_t)alignment; + } + if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } - if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + if (check_size == __Pyx_ImportType_CheckSize_Error_0_29_36 && (size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } - else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + else if (check_size == __Pyx_ImportType_CheckSize_Warn_0_29_36 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", @@ -7044,7 +7102,7 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK -static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { +static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON @@ -7353,7 +7411,7 @@ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -7625,7 +7683,7 @@ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -7821,7 +7879,7 @@ static CYTHON_INLINE unsigned long __Pyx_PyInt_As_unsigned_long(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -8093,7 +8151,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -8289,7 +8347,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -8601,9 +8659,9 @@ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *s } /* FunctionImport */ -#ifndef __PYX_HAVE_RT_ImportFunction -#define __PYX_HAVE_RT_ImportFunction -static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { +#ifndef __PYX_HAVE_RT_ImportFunction_0_29_36 +#define __PYX_HAVE_RT_ImportFunction_0_29_36 +static int __Pyx_ImportFunction_0_29_36(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { diff --git a/ssh2/session.c b/ssh2/session.c index f6a642a0..5be5ad8f 100644 --- a/ssh2/session.c +++ b/ssh2/session.c @@ -1,4 +1,39 @@ -/* Generated by Cython 0.29.32 */ +/* Generated by Cython 0.29.36 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "libssh2/include/libssh2.h", + "libssh2/include/libssh2_publickey.h", + "libssh2/include/libssh2_sftp.h", + "ssh2/ext/find_eol.h" + ], + "extra_compile_args": [ + "-O2" + ], + "include_dirs": [ + "./ssh2", + "ssh2", + "libssh2/include" + ], + "libraries": [ + "ssh2" + ], + "library_dirs": [ + "/home/jake/Programming/ssh2-python/build_dir/src" + ], + "name": "ssh2.session", + "runtime_library_dirs": [ + "$ORIGIN/." + ], + "sources": [ + "ssh2/session.pyx" + ] + }, + "module_name": "ssh2.session" +} +END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN @@ -9,8 +44,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_32" -#define CYTHON_HEX_VERSION 0x001D20F0 +#define CYTHON_ABI "0_29_36" +#define CYTHON_HEX_VERSION 0x001D24F0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -78,16 +113,20 @@ #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900) + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 @@ -202,8 +241,8 @@ #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) && (PY_VERSION_HEX < 0x030C00A6) - #define CYTHON_USE_PYLONG_INTERNALS 1 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5) #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 @@ -229,7 +268,7 @@ #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 - #elif !defined(CYTHON_FAST_THREAD_STATE) && (PY_VERSION_HEX < 0x030C00A6) + #elif !defined(CYTHON_FAST_THREAD_STATE) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL @@ -242,7 +281,7 @@ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5)) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK @@ -365,9 +404,6 @@ #endif #endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define Py_OptimizeFlag 0 -#endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 @@ -445,6 +481,11 @@ #endif #define __Pyx_DefaultClassType PyType_Type #endif +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif @@ -552,11 +593,11 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 - #if defined(PyUnicode_IS_READY) - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) #else - #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) @@ -565,14 +606,14 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) - #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) - #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) - #endif + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif #endif #else #define CYTHON_PEP393_ENABLED 0 @@ -963,9 +1004,9 @@ static const char *__pyx_filename; static const char *__pyx_f[] = { "stringsource", "ssh2/session.pyx", - "env/lib/python3.9/site-packages/Cython/Includes/cpython/type.pxd", - "env/lib/python3.9/site-packages/Cython/Includes/cpython/bool.pxd", - "env/lib/python3.9/site-packages/Cython/Includes/cpython/complex.pxd", + "venvssh2-python/lib64/python3.12/site-packages/Cython/Includes/cpython/type.pxd", + "venvssh2-python/lib64/python3.12/site-packages/Cython/Includes/cpython/bool.pxd", + "venvssh2-python/lib64/python3.12/site-packages/Cython/Includes/cpython/complex.pxd", "ssh2/agent.pxd", "ssh2/channel.pxd", "ssh2/listener.pxd", @@ -1487,18 +1528,18 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS -#define __Pyx_GetModuleGlobalName(var, name) {\ +#define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} -#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ +} while(0) +#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} +} while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) @@ -1558,14 +1599,22 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P static int __Pyx_setup_reduce(PyObject* type_obj); /* TypeImport.proto */ -#ifndef __PYX_HAVE_RT_ImportType_proto -#define __PYX_HAVE_RT_ImportType_proto -enum __Pyx_ImportType_CheckSize { - __Pyx_ImportType_CheckSize_Error = 0, - __Pyx_ImportType_CheckSize_Warn = 1, - __Pyx_ImportType_CheckSize_Ignore = 2 +#ifndef __PYX_HAVE_RT_ImportType_proto_0_29_36 +#define __PYX_HAVE_RT_ImportType_proto_0_29_36 +#if __STDC_VERSION__ >= 201112L +#include +#endif +#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L +#define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) alignof(s) +#else +#define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) sizeof(void*) +#endif +enum __Pyx_ImportType_CheckSize_0_29_36 { + __Pyx_ImportType_CheckSize_Error_0_29_36 = 0, + __Pyx_ImportType_CheckSize_Warn_0_29_36 = 1, + __Pyx_ImportType_CheckSize_Ignore_0_29_36 = 2 }; -static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_0_29_36 check_size); #endif /* Import.proto */ @@ -1646,7 +1695,7 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj static int __Pyx_check_binary_version(void); /* FunctionImport.proto */ -static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); +static int __Pyx_ImportFunction_0_29_36(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); @@ -3708,7 +3757,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_20userauth_list(struct __pyx_o */ __pyx_t_1 = __pyx_f_4ssh2_5utils_to_str(__pyx_v__auth); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 197, __pyx_L1_error) + if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 197, __pyx_L1_error) __pyx_v_auth = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -10896,7 +10945,7 @@ static PyObject *__pyx_tp_new_4ssh2_7session_Session(PyTypeObject *t, CYTHON_UNU static void __pyx_tp_dealloc_4ssh2_7session_Session(PyObject *o) { struct __pyx_obj_4ssh2_7session_Session *p = (struct __pyx_obj_4ssh2_7session_Session *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -11065,7 +11114,7 @@ static PyTypeObject __pyx_type_4ssh2_7session_Session = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -11087,7 +11136,7 @@ static PyObject *__pyx_tp_new_4ssh2_7session_MethodType(PyTypeObject *t, PyObjec static void __pyx_tp_dealloc_4ssh2_7session_MethodType(PyObject *o) { #if CYTHON_USE_TP_FINALIZE - if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -11167,7 +11216,7 @@ static PyTypeObject __pyx_type_4ssh2_7session_MethodType = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -11285,7 +11334,7 @@ static PyTypeObject __pyx_type_4ssh2_7session___pyx_scope_struct__userauth_keybo #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -11486,7 +11535,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { __pyx_umethod_PyString_Type_split.type = (PyObject*)&PyString_Type; - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error); + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(1, 1, __pyx_L1_error) return 0; __pyx_L1_error:; @@ -11577,61 +11626,50 @@ static int __Pyx_modinit_type_import_code(void) { /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_0_29_36(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 - sizeof(PyTypeObject), + sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(PyTypeObject), #else - sizeof(PyHeapTypeObject), + sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(PyHeapTypeObject), #endif - __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error) + __Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(3, 8, __pyx_L1_error) + __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType_0_29_36(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(PyBoolObject),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(3, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(4, 15, __pyx_L1_error) + __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType_0_29_36(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(PyComplexObject),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(4, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("ssh2.agent"); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_4ssh2_5agent_Agent = __Pyx_ImportType(__pyx_t_1, "ssh2.agent", "Agent", sizeof(struct __pyx_obj_4ssh2_5agent_Agent), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_5agent_Agent) __PYX_ERR(5, 24, __pyx_L1_error) + __pyx_ptype_4ssh2_5agent_Agent = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.agent", "Agent", sizeof(struct __pyx_obj_4ssh2_5agent_Agent), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_5agent_Agent),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_5agent_Agent) __PYX_ERR(5, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("ssh2.channel"); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_4ssh2_7channel_Channel = __Pyx_ImportType(__pyx_t_1, "ssh2.channel", "Channel", sizeof(struct __pyx_obj_4ssh2_7channel_Channel), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_7channel_Channel) __PYX_ERR(6, 24, __pyx_L1_error) + __pyx_ptype_4ssh2_7channel_Channel = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.channel", "Channel", sizeof(struct __pyx_obj_4ssh2_7channel_Channel), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_7channel_Channel),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_7channel_Channel) __PYX_ERR(6, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("ssh2.listener"); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_4ssh2_8listener_Listener = __Pyx_ImportType(__pyx_t_1, "ssh2.listener", "Listener", sizeof(struct __pyx_obj_4ssh2_8listener_Listener), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_8listener_Listener) __PYX_ERR(7, 24, __pyx_L1_error) + __pyx_ptype_4ssh2_8listener_Listener = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.listener", "Listener", sizeof(struct __pyx_obj_4ssh2_8listener_Listener), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_8listener_Listener),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_8listener_Listener) __PYX_ERR(7, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("ssh2.sftp"); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_4ssh2_4sftp_SFTP = __Pyx_ImportType(__pyx_t_1, "ssh2.sftp", "SFTP", sizeof(struct __pyx_obj_4ssh2_4sftp_SFTP), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_4sftp_SFTP) __PYX_ERR(8, 26, __pyx_L1_error) + __pyx_ptype_4ssh2_4sftp_SFTP = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.sftp", "SFTP", sizeof(struct __pyx_obj_4ssh2_4sftp_SFTP), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_4sftp_SFTP),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_4sftp_SFTP) __PYX_ERR(8, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("ssh2.statinfo"); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_4ssh2_8statinfo_StatInfo = __Pyx_ImportType(__pyx_t_1, "ssh2.statinfo", "StatInfo", sizeof(struct __pyx_obj_4ssh2_8statinfo_StatInfo), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_8statinfo_StatInfo) __PYX_ERR(9, 20, __pyx_L1_error) + __pyx_ptype_4ssh2_8statinfo_StatInfo = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.statinfo", "StatInfo", sizeof(struct __pyx_obj_4ssh2_8statinfo_StatInfo), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_8statinfo_StatInfo),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_8statinfo_StatInfo) __PYX_ERR(9, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("ssh2.knownhost"); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_4ssh2_9knownhost_KnownHostEntry = __Pyx_ImportType(__pyx_t_1, "ssh2.knownhost", "KnownHostEntry", sizeof(struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_9knownhost_KnownHostEntry) __PYX_ERR(10, 24, __pyx_L1_error) - __pyx_ptype_4ssh2_9knownhost_KnownHost = __Pyx_ImportType(__pyx_t_1, "ssh2.knownhost", "KnownHost", sizeof(struct __pyx_obj_4ssh2_9knownhost_KnownHost), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_9knownhost_KnownHost) __PYX_ERR(10, 28, __pyx_L1_error) + __pyx_ptype_4ssh2_9knownhost_KnownHostEntry = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.knownhost", "KnownHostEntry", sizeof(struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_9knownhost_KnownHostEntry),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_9knownhost_KnownHostEntry) __PYX_ERR(10, 24, __pyx_L1_error) + __pyx_ptype_4ssh2_9knownhost_KnownHost = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.knownhost", "KnownHost", sizeof(struct __pyx_obj_4ssh2_9knownhost_KnownHost), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_9knownhost_KnownHost),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_9knownhost_KnownHost) __PYX_ERR(10, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("ssh2.fileinfo"); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_4ssh2_8fileinfo_FileInfo = __Pyx_ImportType(__pyx_t_1, "ssh2.fileinfo", "FileInfo", sizeof(struct __pyx_obj_4ssh2_8fileinfo_FileInfo), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_8fileinfo_FileInfo) __PYX_ERR(11, 19, __pyx_L1_error) + __pyx_ptype_4ssh2_8fileinfo_FileInfo = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.fileinfo", "FileInfo", sizeof(struct __pyx_obj_4ssh2_8fileinfo_FileInfo), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_8fileinfo_FileInfo),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_8fileinfo_FileInfo) __PYX_ERR(11, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -11659,36 +11697,36 @@ static int __Pyx_modinit_function_import_code(void) { /*--- Function import code ---*/ __pyx_t_1 = PyImport_ImportModule("ssh2.agent"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_ImportFunction(__pyx_t_1, "PyAgent", (void (**)(void))&__pyx_f_4ssh2_5agent_PyAgent, "PyObject *(LIBSSH2_AGENT *, struct __pyx_obj_4ssh2_7session_Session *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) - if (__Pyx_ImportFunction(__pyx_t_1, "agent_auth", (void (**)(void))&__pyx_f_4ssh2_5agent_agent_auth, "int (char *, LIBSSH2_AGENT *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) - if (__Pyx_ImportFunction(__pyx_t_1, "init_connect_agent", (void (**)(void))&__pyx_f_4ssh2_5agent_init_connect_agent, "LIBSSH2_AGENT *(LIBSSH2_SESSION *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) - if (__Pyx_ImportFunction(__pyx_t_1, "agent_init", (void (**)(void))&__pyx_f_4ssh2_5agent_agent_init, "LIBSSH2_AGENT *(LIBSSH2_SESSION *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "PyAgent", (void (**)(void))&__pyx_f_4ssh2_5agent_PyAgent, "PyObject *(LIBSSH2_AGENT *, struct __pyx_obj_4ssh2_7session_Session *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "agent_auth", (void (**)(void))&__pyx_f_4ssh2_5agent_agent_auth, "int (char *, LIBSSH2_AGENT *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "init_connect_agent", (void (**)(void))&__pyx_f_4ssh2_5agent_init_connect_agent, "LIBSSH2_AGENT *(LIBSSH2_SESSION *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "agent_init", (void (**)(void))&__pyx_f_4ssh2_5agent_agent_init, "LIBSSH2_AGENT *(LIBSSH2_SESSION *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("ssh2.channel"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_ImportFunction(__pyx_t_1, "PyChannel", (void (**)(void))&__pyx_f_4ssh2_7channel_PyChannel, "PyObject *(LIBSSH2_CHANNEL *, struct __pyx_obj_4ssh2_7session_Session *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "PyChannel", (void (**)(void))&__pyx_f_4ssh2_7channel_PyChannel, "PyObject *(LIBSSH2_CHANNEL *, struct __pyx_obj_4ssh2_7session_Session *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("ssh2.listener"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_ImportFunction(__pyx_t_1, "PyListener", (void (**)(void))&__pyx_f_4ssh2_8listener_PyListener, "PyObject *(LIBSSH2_LISTENER *, struct __pyx_obj_4ssh2_7session_Session *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "PyListener", (void (**)(void))&__pyx_f_4ssh2_8listener_PyListener, "PyObject *(LIBSSH2_LISTENER *, struct __pyx_obj_4ssh2_7session_Session *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("ssh2.sftp"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_ImportFunction(__pyx_t_1, "PySFTP", (void (**)(void))&__pyx_f_4ssh2_4sftp_PySFTP, "PyObject *(LIBSSH2_SFTP *, struct __pyx_obj_4ssh2_7session_Session *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "PySFTP", (void (**)(void))&__pyx_f_4ssh2_4sftp_PySFTP, "PyObject *(LIBSSH2_SFTP *, struct __pyx_obj_4ssh2_7session_Session *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("ssh2.publickey"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_ImportFunction(__pyx_t_1, "PyPublicKeySystem", (void (**)(void))&__pyx_f_4ssh2_9publickey_PyPublicKeySystem, "PyObject *(LIBSSH2_PUBLICKEY *, struct __pyx_obj_4ssh2_7session_Session *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "PyPublicKeySystem", (void (**)(void))&__pyx_f_4ssh2_9publickey_PyPublicKeySystem, "PyObject *(LIBSSH2_PUBLICKEY *, struct __pyx_obj_4ssh2_7session_Session *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("ssh2.utils"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_ImportFunction(__pyx_t_1, "to_bytes", (void (**)(void))&__pyx_f_4ssh2_5utils_to_bytes, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) - if (__Pyx_ImportFunction(__pyx_t_1, "to_str", (void (**)(void))&__pyx_f_4ssh2_5utils_to_str, "PyObject *(char *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) - if (__Pyx_ImportFunction(__pyx_t_1, "handle_error_codes", (void (**)(void))&__pyx_f_4ssh2_5utils_handle_error_codes, "int (int, int __pyx_skip_dispatch)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "to_bytes", (void (**)(void))&__pyx_f_4ssh2_5utils_to_bytes, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "to_str", (void (**)(void))&__pyx_f_4ssh2_5utils_to_str, "PyObject *(char *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "handle_error_codes", (void (**)(void))&__pyx_f_4ssh2_5utils_handle_error_codes, "int (int, int __pyx_skip_dispatch)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("ssh2.knownhost"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_ImportFunction(__pyx_t_1, "PyKnownHost", (void (**)(void))&__pyx_f_4ssh2_9knownhost_PyKnownHost, "struct __pyx_obj_4ssh2_9knownhost_KnownHost *(struct __pyx_obj_4ssh2_7session_Session *, LIBSSH2_KNOWNHOSTS *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "PyKnownHost", (void (**)(void))&__pyx_f_4ssh2_9knownhost_PyKnownHost, "struct __pyx_obj_4ssh2_9knownhost_KnownHost *(struct __pyx_obj_4ssh2_7session_Session *, LIBSSH2_KNOWNHOSTS *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -11865,7 +11903,7 @@ if (!__Pyx_RefNanny) { Py_INCREF(__pyx_b); __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error) Py_INCREF(__pyx_cython_runtime); - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) @@ -12639,17 +12677,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } PyErr_SetObject(type, value); if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - 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 +#if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { @@ -12657,6 +12685,12 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); #endif } bad: @@ -12812,7 +12846,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { return __Pyx_PyFunction_FastCall(func, NULL, 0); } #endif -#ifdef __Pyx_CyFunction_USED +#if defined(__Pyx_CyFunction_USED) && defined(NDEBUG) if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) #else if (likely(PyCFunction_Check(func))) @@ -12957,11 +12991,11 @@ static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* if (flag == METH_O) { return (*(cfunc->func))(self, arg); } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) { - if (PY_VERSION_HEX >= 0x030700A0) { + #if PY_VERSION_HEX >= 0x030700A0 return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); - } else { + #else return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); - } + #endif } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) { return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); } @@ -13563,9 +13597,14 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); +#if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); +#else + PyErr_SetString(PyExc_TypeError, + "unbound method needs an argument"); +#endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); @@ -13640,7 +13679,10 @@ static PyTypeObject __pyx_CyFunctionType_type = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, #endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 +#if PY_VERSION_HEX >= 0x030C0000 + 0, +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; @@ -14147,16 +14189,18 @@ static int __Pyx_setup_reduce(PyObject* type_obj) { } /* TypeImport */ -#ifndef __PYX_HAVE_RT_ImportType -#define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, - size_t size, enum __Pyx_ImportType_CheckSize check_size) +#ifndef __PYX_HAVE_RT_ImportType_0_29_36 +#define __PYX_HAVE_RT_ImportType_0_29_36 +static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject *module, const char *module_name, const char *class_name, + size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_0_29_36 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; + Py_ssize_t itemsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; + PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) @@ -14169,6 +14213,7 @@ static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; + itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) @@ -14178,22 +14223,37 @@ static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; + py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); + if (!py_itemsize) + goto bad; + itemsize = PyLong_AsSsize_t(py_itemsize); + Py_DECREF(py_itemsize); + py_itemsize = 0; + if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; #endif - if ((size_t)basicsize < size) { + if (itemsize) { + if (size % alignment) { + alignment = size % alignment; + } + if (itemsize < (Py_ssize_t)alignment) + itemsize = (Py_ssize_t)alignment; + } + if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } - if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + if (check_size == __Pyx_ImportType_CheckSize_Error_0_29_36 && (size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } - else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + else if (check_size == __Pyx_ImportType_CheckSize_Warn_0_29_36 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", @@ -14288,7 +14348,7 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK -static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { +static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON @@ -14635,7 +14695,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -14831,7 +14891,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -15027,7 +15087,7 @@ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -15223,7 +15283,7 @@ static CYTHON_INLINE libssh2_uint64_t __Pyx_PyInt_As_libssh2_uint64_t(PyObject * break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -15419,7 +15479,7 @@ static CYTHON_INLINE time_t __Pyx_PyInt_As_time_t(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -15615,7 +15675,7 @@ static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -15928,9 +15988,9 @@ static int __Pyx_check_binary_version(void) { } /* FunctionImport */ -#ifndef __PYX_HAVE_RT_ImportFunction -#define __PYX_HAVE_RT_ImportFunction -static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { +#ifndef __PYX_HAVE_RT_ImportFunction_0_29_36 +#define __PYX_HAVE_RT_ImportFunction_0_29_36 +static int __Pyx_ImportFunction_0_29_36(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { diff --git a/ssh2/sftp.c b/ssh2/sftp.c index 5a15558e..81649e39 100644 --- a/ssh2/sftp.c +++ b/ssh2/sftp.c @@ -1,4 +1,38 @@ -/* Generated by Cython 0.29.32 */ +/* Generated by Cython 0.29.36 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "libssh2/include/libssh2.h", + "libssh2/include/libssh2_sftp.h", + "ssh2/ext/find_eol.h" + ], + "extra_compile_args": [ + "-O2" + ], + "include_dirs": [ + "./ssh2", + "ssh2", + "libssh2/include" + ], + "libraries": [ + "ssh2" + ], + "library_dirs": [ + "/home/jake/Programming/ssh2-python/build_dir/src" + ], + "name": "ssh2.sftp", + "runtime_library_dirs": [ + "$ORIGIN/." + ], + "sources": [ + "ssh2/sftp.pyx" + ] + }, + "module_name": "ssh2.sftp" +} +END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN @@ -9,8 +43,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_32" -#define CYTHON_HEX_VERSION 0x001D20F0 +#define CYTHON_ABI "0_29_36" +#define CYTHON_HEX_VERSION 0x001D24F0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -78,16 +112,20 @@ #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900) + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 @@ -202,8 +240,8 @@ #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) && (PY_VERSION_HEX < 0x030C00A6) - #define CYTHON_USE_PYLONG_INTERNALS 1 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5) #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 @@ -229,7 +267,7 @@ #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 - #elif !defined(CYTHON_FAST_THREAD_STATE) && (PY_VERSION_HEX < 0x030C00A6) + #elif !defined(CYTHON_FAST_THREAD_STATE) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL @@ -242,7 +280,7 @@ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5)) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK @@ -365,9 +403,6 @@ #endif #endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define Py_OptimizeFlag 0 -#endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 @@ -445,6 +480,11 @@ #endif #define __Pyx_DefaultClassType PyType_Type #endif +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif @@ -552,11 +592,11 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 - #if defined(PyUnicode_IS_READY) - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) #else - #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) @@ -565,14 +605,14 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) - #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) - #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) - #endif + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif #endif #else #define CYTHON_PEP393_ENABLED 0 @@ -1339,14 +1379,22 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P static int __Pyx_setup_reduce(PyObject* type_obj); /* TypeImport.proto */ -#ifndef __PYX_HAVE_RT_ImportType_proto -#define __PYX_HAVE_RT_ImportType_proto -enum __Pyx_ImportType_CheckSize { - __Pyx_ImportType_CheckSize_Error = 0, - __Pyx_ImportType_CheckSize_Warn = 1, - __Pyx_ImportType_CheckSize_Ignore = 2 +#ifndef __PYX_HAVE_RT_ImportType_proto_0_29_36 +#define __PYX_HAVE_RT_ImportType_proto_0_29_36 +#if __STDC_VERSION__ >= 201112L +#include +#endif +#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L +#define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) alignof(s) +#else +#define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) sizeof(void*) +#endif +enum __Pyx_ImportType_CheckSize_0_29_36 { + __Pyx_ImportType_CheckSize_Error_0_29_36 = 0, + __Pyx_ImportType_CheckSize_Warn_0_29_36 = 1, + __Pyx_ImportType_CheckSize_Ignore_0_29_36 = 2 }; -static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_0_29_36 check_size); #endif /* PyDictVersioning.proto */ @@ -1450,7 +1498,7 @@ static int __Pyx_check_binary_version(void); static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* FunctionImport.proto */ -static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); +static int __Pyx_ImportFunction_0_29_36(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); @@ -5429,7 +5477,7 @@ static PyObject *__pyx_tp_new_4ssh2_4sftp_SFTP(PyTypeObject *t, PyObject *a, PyO static void __pyx_tp_dealloc_4ssh2_4sftp_SFTP(PyObject *o) { struct __pyx_obj_4ssh2_4sftp_SFTP *p = (struct __pyx_obj_4ssh2_4sftp_SFTP *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -5562,7 +5610,7 @@ static PyTypeObject __pyx_type_4ssh2_4sftp_SFTP = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -5714,7 +5762,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { } static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -5793,24 +5841,18 @@ static int __Pyx_modinit_type_import_code(void) { /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule("ssh2.session"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_4ssh2_7session_Session = __Pyx_ImportType(__pyx_t_1, "ssh2.session", "Session", sizeof(struct __pyx_obj_4ssh2_7session_Session), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_7session_Session) __PYX_ERR(2, 19, __pyx_L1_error) - __pyx_ptype_4ssh2_7session_MethodType = __Pyx_ImportType(__pyx_t_1, "ssh2.session", "MethodType", sizeof(struct __pyx_obj_4ssh2_7session_MethodType), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_7session_MethodType) __PYX_ERR(2, 26, __pyx_L1_error) + __pyx_ptype_4ssh2_7session_Session = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.session", "Session", sizeof(struct __pyx_obj_4ssh2_7session_Session), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_7session_Session),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_7session_Session) __PYX_ERR(2, 19, __pyx_L1_error) + __pyx_ptype_4ssh2_7session_MethodType = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.session", "MethodType", sizeof(struct __pyx_obj_4ssh2_7session_MethodType), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_7session_MethodType),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_7session_MethodType) __PYX_ERR(2, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("ssh2.channel"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_4ssh2_7channel_Channel = __Pyx_ImportType(__pyx_t_1, "ssh2.channel", "Channel", sizeof(struct __pyx_obj_4ssh2_7channel_Channel), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_7channel_Channel) __PYX_ERR(3, 24, __pyx_L1_error) + __pyx_ptype_4ssh2_7channel_Channel = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.channel", "Channel", sizeof(struct __pyx_obj_4ssh2_7channel_Channel), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_7channel_Channel),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_7channel_Channel) __PYX_ERR(3, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("ssh2.sftp_handle"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_4ssh2_11sftp_handle_SFTPHandle = __Pyx_ImportType(__pyx_t_1, "ssh2.sftp_handle", "SFTPHandle", sizeof(struct __pyx_obj_4ssh2_11sftp_handle_SFTPHandle), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_11sftp_handle_SFTPHandle) __PYX_ERR(4, 25, __pyx_L1_error) - __pyx_ptype_4ssh2_11sftp_handle_SFTPAttributes = __Pyx_ImportType(__pyx_t_1, "ssh2.sftp_handle", "SFTPAttributes", sizeof(struct __pyx_obj_4ssh2_11sftp_handle_SFTPAttributes), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_11sftp_handle_SFTPAttributes) __PYX_ERR(4, 31, __pyx_L1_error) - __pyx_ptype_4ssh2_11sftp_handle_SFTPStatVFS = __Pyx_ImportType(__pyx_t_1, "ssh2.sftp_handle", "SFTPStatVFS", sizeof(struct __pyx_obj_4ssh2_11sftp_handle_SFTPStatVFS), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_11sftp_handle_SFTPStatVFS) __PYX_ERR(4, 35, __pyx_L1_error) + __pyx_ptype_4ssh2_11sftp_handle_SFTPHandle = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.sftp_handle", "SFTPHandle", sizeof(struct __pyx_obj_4ssh2_11sftp_handle_SFTPHandle), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_11sftp_handle_SFTPHandle),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_11sftp_handle_SFTPHandle) __PYX_ERR(4, 25, __pyx_L1_error) + __pyx_ptype_4ssh2_11sftp_handle_SFTPAttributes = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.sftp_handle", "SFTPAttributes", sizeof(struct __pyx_obj_4ssh2_11sftp_handle_SFTPAttributes), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_11sftp_handle_SFTPAttributes),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_11sftp_handle_SFTPAttributes) __PYX_ERR(4, 31, __pyx_L1_error) + __pyx_ptype_4ssh2_11sftp_handle_SFTPStatVFS = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.sftp_handle", "SFTPStatVFS", sizeof(struct __pyx_obj_4ssh2_11sftp_handle_SFTPStatVFS), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_11sftp_handle_SFTPStatVFS),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_11sftp_handle_SFTPStatVFS) __PYX_ERR(4, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -5838,17 +5880,17 @@ static int __Pyx_modinit_function_import_code(void) { /*--- Function import code ---*/ __pyx_t_1 = PyImport_ImportModule("ssh2.channel"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_ImportFunction(__pyx_t_1, "PyChannel", (void (**)(void))&__pyx_f_4ssh2_7channel_PyChannel, "PyObject *(LIBSSH2_CHANNEL *, struct __pyx_obj_4ssh2_7session_Session *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "PyChannel", (void (**)(void))&__pyx_f_4ssh2_7channel_PyChannel, "PyObject *(LIBSSH2_CHANNEL *, struct __pyx_obj_4ssh2_7session_Session *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("ssh2.utils"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_ImportFunction(__pyx_t_1, "to_bytes", (void (**)(void))&__pyx_f_4ssh2_5utils_to_bytes, "PyObject *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportFunction(__pyx_t_1, "to_str_len", (void (**)(void))&__pyx_f_4ssh2_5utils_to_str_len, "PyObject *(char *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportFunction(__pyx_t_1, "handle_error_codes", (void (**)(void))&__pyx_f_4ssh2_5utils_handle_error_codes, "int (int, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "to_bytes", (void (**)(void))&__pyx_f_4ssh2_5utils_to_bytes, "PyObject *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "to_str_len", (void (**)(void))&__pyx_f_4ssh2_5utils_to_str_len, "PyObject *(char *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "handle_error_codes", (void (**)(void))&__pyx_f_4ssh2_5utils_handle_error_codes, "int (int, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("ssh2.sftp_handle"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_ImportFunction(__pyx_t_1, "PySFTPHandle", (void (**)(void))&__pyx_f_4ssh2_11sftp_handle_PySFTPHandle, "PyObject *(LIBSSH2_SFTP_HANDLE *, struct __pyx_obj_4ssh2_4sftp_SFTP *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "PySFTPHandle", (void (**)(void))&__pyx_f_4ssh2_11sftp_handle_PySFTPHandle, "PyObject *(LIBSSH2_SFTP_HANDLE *, struct __pyx_obj_4ssh2_4sftp_SFTP *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -6024,7 +6066,7 @@ if (!__Pyx_RefNanny) { Py_INCREF(__pyx_b); __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_cython_runtime); - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) @@ -6919,7 +6961,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { return __Pyx_PyFunction_FastCall(func, NULL, 0); } #endif -#ifdef __Pyx_CyFunction_USED +#if defined(__Pyx_CyFunction_USED) && defined(NDEBUG) if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) #else if (likely(PyCFunction_Check(func))) @@ -7280,17 +7322,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } PyErr_SetObject(type, value); if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - 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 +#if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { @@ -7298,6 +7330,12 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); #endif } bad: @@ -7508,16 +7546,18 @@ static int __Pyx_setup_reduce(PyObject* type_obj) { } /* TypeImport */ -#ifndef __PYX_HAVE_RT_ImportType -#define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, - size_t size, enum __Pyx_ImportType_CheckSize check_size) +#ifndef __PYX_HAVE_RT_ImportType_0_29_36 +#define __PYX_HAVE_RT_ImportType_0_29_36 +static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject *module, const char *module_name, const char *class_name, + size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_0_29_36 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; + Py_ssize_t itemsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; + PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) @@ -7530,6 +7570,7 @@ static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; + itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) @@ -7539,22 +7580,37 @@ static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; + py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); + if (!py_itemsize) + goto bad; + itemsize = PyLong_AsSsize_t(py_itemsize); + Py_DECREF(py_itemsize); + py_itemsize = 0; + if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; #endif - if ((size_t)basicsize < size) { + if (itemsize) { + if (size % alignment) { + alignment = size % alignment; + } + if (itemsize < (Py_ssize_t)alignment) + itemsize = (Py_ssize_t)alignment; + } + if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } - if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + if (check_size == __Pyx_ImportType_CheckSize_Error_0_29_36 && (size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } - else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + else if (check_size == __Pyx_ImportType_CheckSize_Warn_0_29_36 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", @@ -7596,7 +7652,7 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK -static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { +static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON @@ -7943,7 +7999,7 @@ static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -8139,7 +8195,7 @@ static CYTHON_INLINE unsigned long __Pyx_PyInt_As_unsigned_long(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -8335,7 +8391,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -8531,7 +8587,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -8727,7 +8783,7 @@ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -9115,9 +9171,9 @@ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *s } /* FunctionImport */ -#ifndef __PYX_HAVE_RT_ImportFunction -#define __PYX_HAVE_RT_ImportFunction -static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { +#ifndef __PYX_HAVE_RT_ImportFunction_0_29_36 +#define __PYX_HAVE_RT_ImportFunction_0_29_36 +static int __Pyx_ImportFunction_0_29_36(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { diff --git a/ssh2/sftp_handle.c b/ssh2/sftp_handle.c index 8771fc66..e483c18f 100644 --- a/ssh2/sftp_handle.c +++ b/ssh2/sftp_handle.c @@ -1,4 +1,38 @@ -/* Generated by Cython 0.29.32 */ +/* Generated by Cython 0.29.36 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "libssh2/include/libssh2.h", + "libssh2/include/libssh2_sftp.h", + "ssh2/ext/find_eol.h" + ], + "extra_compile_args": [ + "-O2" + ], + "include_dirs": [ + "./ssh2", + "ssh2", + "libssh2/include" + ], + "libraries": [ + "ssh2" + ], + "library_dirs": [ + "/home/jake/Programming/ssh2-python/build_dir/src" + ], + "name": "ssh2.sftp_handle", + "runtime_library_dirs": [ + "$ORIGIN/." + ], + "sources": [ + "ssh2/sftp_handle.pyx" + ] + }, + "module_name": "ssh2.sftp_handle" +} +END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN @@ -9,8 +43,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_32" -#define CYTHON_HEX_VERSION 0x001D20F0 +#define CYTHON_ABI "0_29_36" +#define CYTHON_HEX_VERSION 0x001D24F0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -78,16 +112,20 @@ #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900) + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 @@ -202,8 +240,8 @@ #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) && (PY_VERSION_HEX < 0x030C00A6) - #define CYTHON_USE_PYLONG_INTERNALS 1 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5) #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 @@ -229,7 +267,7 @@ #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 - #elif !defined(CYTHON_FAST_THREAD_STATE) && (PY_VERSION_HEX < 0x030C00A6) + #elif !defined(CYTHON_FAST_THREAD_STATE) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL @@ -242,7 +280,7 @@ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5)) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK @@ -365,9 +403,6 @@ #endif #endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define Py_OptimizeFlag 0 -#endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 @@ -445,6 +480,11 @@ #endif #define __Pyx_DefaultClassType PyType_Type #endif +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif @@ -552,11 +592,11 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 - #if defined(PyUnicode_IS_READY) - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) #else - #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) @@ -565,14 +605,14 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) - #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) - #endif - #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif #endif #else #define CYTHON_PEP393_ENABLED 0 @@ -1383,14 +1423,22 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P static int __Pyx_setup_reduce(PyObject* type_obj); /* TypeImport.proto */ -#ifndef __PYX_HAVE_RT_ImportType_proto -#define __PYX_HAVE_RT_ImportType_proto -enum __Pyx_ImportType_CheckSize { - __Pyx_ImportType_CheckSize_Error = 0, - __Pyx_ImportType_CheckSize_Warn = 1, - __Pyx_ImportType_CheckSize_Ignore = 2 +#ifndef __PYX_HAVE_RT_ImportType_proto_0_29_36 +#define __PYX_HAVE_RT_ImportType_proto_0_29_36 +#if __STDC_VERSION__ >= 201112L +#include +#endif +#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L +#define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) alignof(s) +#else +#define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) sizeof(void*) +#endif +enum __Pyx_ImportType_CheckSize_0_29_36 { + __Pyx_ImportType_CheckSize_Error_0_29_36 = 0, + __Pyx_ImportType_CheckSize_Warn_0_29_36 = 1, + __Pyx_ImportType_CheckSize_Ignore_0_29_36 = 2 }; -static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_0_29_36 check_size); #endif /* PyDictVersioning.proto */ @@ -1582,7 +1630,7 @@ static int __Pyx_check_binary_version(void); static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* FunctionImport.proto */ -static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); +static int __Pyx_ImportFunction_0_29_36(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); @@ -3541,7 +3589,7 @@ static PyObject *__pyx_pf_4ssh2_11sftp_handle_10SFTPHandle_6__next__(struct __py } __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 130, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 130, __pyx_L1_error) __pyx_v_rc = __pyx_t_6; __pyx_v_data = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; @@ -8922,7 +8970,7 @@ static PyObject *__pyx_tp_new_4ssh2_11sftp_handle_SFTPHandle(PyTypeObject *t, Py static void __pyx_tp_dealloc_4ssh2_11sftp_handle_SFTPHandle(PyObject *o) { struct __pyx_obj_4ssh2_11sftp_handle_SFTPHandle *p = (struct __pyx_obj_4ssh2_11sftp_handle_SFTPHandle *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -9052,7 +9100,7 @@ static PyTypeObject __pyx_type_4ssh2_11sftp_handle_SFTPHandle = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -9074,7 +9122,7 @@ static PyObject *__pyx_tp_new_4ssh2_11sftp_handle_SFTPAttributes(PyTypeObject *t static void __pyx_tp_dealloc_4ssh2_11sftp_handle_SFTPAttributes(PyObject *o) { #if CYTHON_USE_TP_FINALIZE - if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -9271,7 +9319,7 @@ static PyTypeObject __pyx_type_4ssh2_11sftp_handle_SFTPAttributes = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -9297,7 +9345,7 @@ static PyObject *__pyx_tp_new_4ssh2_11sftp_handle_SFTPStatVFS(PyTypeObject *t, P static void __pyx_tp_dealloc_4ssh2_11sftp_handle_SFTPStatVFS(PyObject *o) { struct __pyx_obj_4ssh2_11sftp_handle_SFTPStatVFS *p = (struct __pyx_obj_4ssh2_11sftp_handle_SFTPStatVFS *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -9464,7 +9512,7 @@ static PyTypeObject __pyx_type_4ssh2_11sftp_handle_SFTPStatVFS = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -9593,7 +9641,7 @@ static PyTypeObject __pyx_type_4ssh2_11sftp_handle___pyx_scope_struct__readdir_e #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -9714,7 +9762,7 @@ static PyTypeObject __pyx_type_4ssh2_11sftp_handle___pyx_scope_struct_1_readdir #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -9880,7 +9928,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { } static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; @@ -9996,15 +10044,12 @@ static int __Pyx_modinit_type_import_code(void) { /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule("ssh2.session"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_4ssh2_7session_Session = __Pyx_ImportType(__pyx_t_1, "ssh2.session", "Session", sizeof(struct __pyx_obj_4ssh2_7session_Session), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_7session_Session) __PYX_ERR(2, 19, __pyx_L1_error) - __pyx_ptype_4ssh2_7session_MethodType = __Pyx_ImportType(__pyx_t_1, "ssh2.session", "MethodType", sizeof(struct __pyx_obj_4ssh2_7session_MethodType), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_7session_MethodType) __PYX_ERR(2, 26, __pyx_L1_error) + __pyx_ptype_4ssh2_7session_Session = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.session", "Session", sizeof(struct __pyx_obj_4ssh2_7session_Session), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_7session_Session),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_7session_Session) __PYX_ERR(2, 19, __pyx_L1_error) + __pyx_ptype_4ssh2_7session_MethodType = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.session", "MethodType", sizeof(struct __pyx_obj_4ssh2_7session_MethodType), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_7session_MethodType),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_7session_MethodType) __PYX_ERR(2, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("ssh2.sftp"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_4ssh2_4sftp_SFTP = __Pyx_ImportType(__pyx_t_1, "ssh2.sftp", "SFTP", sizeof(struct __pyx_obj_4ssh2_4sftp_SFTP), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_4sftp_SFTP) __PYX_ERR(3, 26, __pyx_L1_error) + __pyx_ptype_4ssh2_4sftp_SFTP = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.sftp", "SFTP", sizeof(struct __pyx_obj_4ssh2_4sftp_SFTP), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_4sftp_SFTP),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_4sftp_SFTP) __PYX_ERR(3, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -10032,7 +10077,7 @@ static int __Pyx_modinit_function_import_code(void) { /*--- Function import code ---*/ __pyx_t_1 = PyImport_ImportModule("ssh2.utils"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_ImportFunction(__pyx_t_1, "handle_error_codes", (void (**)(void))&__pyx_f_4ssh2_5utils_handle_error_codes, "int (int, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "handle_error_codes", (void (**)(void))&__pyx_f_4ssh2_5utils_handle_error_codes, "int (int, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -10208,7 +10253,7 @@ if (!__Pyx_RefNanny) { Py_INCREF(__pyx_b); __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_cython_runtime); - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) @@ -10578,17 +10623,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } PyErr_SetObject(type, value); if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - 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 +#if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { @@ -10596,6 +10631,12 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); #endif } bad: @@ -10880,7 +10921,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { return __Pyx_PyFunction_FastCall(func, NULL, 0); } #endif -#ifdef __Pyx_CyFunction_USED +#if defined(__Pyx_CyFunction_USED) && defined(NDEBUG) if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) #else if (likely(PyCFunction_Check(func))) @@ -11011,10 +11052,8 @@ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; - } else { - return __Pyx_IterFinish(); } - return 0; + return __Pyx_IterFinish(); } /* GetException */ @@ -11434,16 +11473,18 @@ static int __Pyx_setup_reduce(PyObject* type_obj) { } /* TypeImport */ -#ifndef __PYX_HAVE_RT_ImportType -#define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, - size_t size, enum __Pyx_ImportType_CheckSize check_size) +#ifndef __PYX_HAVE_RT_ImportType_0_29_36 +#define __PYX_HAVE_RT_ImportType_0_29_36 +static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject *module, const char *module_name, const char *class_name, + size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_0_29_36 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; + Py_ssize_t itemsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; + PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) @@ -11456,6 +11497,7 @@ static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; + itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) @@ -11465,22 +11507,37 @@ static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; + py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); + if (!py_itemsize) + goto bad; + itemsize = PyLong_AsSsize_t(py_itemsize); + Py_DECREF(py_itemsize); + py_itemsize = 0; + if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; #endif - if ((size_t)basicsize < size) { + if (itemsize) { + if (size % alignment) { + alignment = size % alignment; + } + if (itemsize < (Py_ssize_t)alignment) + itemsize = (Py_ssize_t)alignment; + } + if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } - if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + if (check_size == __Pyx_ImportType_CheckSize_Error_0_29_36 && (size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } - else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + else if (check_size == __Pyx_ImportType_CheckSize_Warn_0_29_36 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", @@ -11522,7 +11579,7 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK -static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { +static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON @@ -11831,7 +11888,7 @@ static CYTHON_INLINE unsigned long __Pyx_PyInt_As_unsigned_long(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -12027,7 +12084,7 @@ static CYTHON_INLINE libssh2_uint64_t __Pyx_PyInt_As_libssh2_uint64_t(PyObject * break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -12223,7 +12280,7 @@ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -12419,7 +12476,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -12767,7 +12824,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -14136,7 +14193,10 @@ static PyTypeObject __pyx_GeneratorType_type = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, #endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 +#if PY_VERSION_HEX >= 0x030C0000 + 0, +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; @@ -14226,9 +14286,9 @@ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *s } /* FunctionImport */ -#ifndef __PYX_HAVE_RT_ImportFunction -#define __PYX_HAVE_RT_ImportFunction -static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { +#ifndef __PYX_HAVE_RT_ImportFunction_0_29_36 +#define __PYX_HAVE_RT_ImportFunction_0_29_36 +static int __Pyx_ImportFunction_0_29_36(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { diff --git a/ssh2/statinfo.c b/ssh2/statinfo.c index 51a42f43..111008a6 100644 --- a/ssh2/statinfo.c +++ b/ssh2/statinfo.c @@ -1,4 +1,32 @@ -/* Generated by Cython 0.29.32 */ +/* Generated by Cython 0.29.36 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [], + "extra_compile_args": [ + "-O2" + ], + "include_dirs": [ + "libssh2/include" + ], + "libraries": [ + "ssh2" + ], + "library_dirs": [ + "/home/jake/Programming/ssh2-python/build_dir/src" + ], + "name": "ssh2.statinfo", + "runtime_library_dirs": [ + "$ORIGIN/." + ], + "sources": [ + "ssh2/statinfo.pyx" + ] + }, + "module_name": "ssh2.statinfo" +} +END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN @@ -9,8 +37,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_32" -#define CYTHON_HEX_VERSION 0x001D20F0 +#define CYTHON_ABI "0_29_36" +#define CYTHON_HEX_VERSION 0x001D24F0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -78,16 +106,20 @@ #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900) + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 @@ -202,8 +234,8 @@ #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) && (PY_VERSION_HEX < 0x030C00A6) - #define CYTHON_USE_PYLONG_INTERNALS 1 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5) #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 @@ -229,7 +261,7 @@ #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 - #elif !defined(CYTHON_FAST_THREAD_STATE) && (PY_VERSION_HEX < 0x030C00A6) + #elif !defined(CYTHON_FAST_THREAD_STATE) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL @@ -242,7 +274,7 @@ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5)) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK @@ -365,9 +397,6 @@ #endif #endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define Py_OptimizeFlag 0 -#endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 @@ -445,6 +474,11 @@ #endif #define __Pyx_DefaultClassType PyType_Type #endif +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif @@ -552,11 +586,11 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 - #if defined(PyUnicode_IS_READY) - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) #else - #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) @@ -565,14 +599,14 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) - #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) - #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) - #endif + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif #endif #else #define CYTHON_PEP393_ENABLED 0 @@ -2339,7 +2373,7 @@ static PyObject *__pyx_tp_new_4ssh2_8statinfo_StatInfo(PyTypeObject *t, CYTHON_U static void __pyx_tp_dealloc_4ssh2_8statinfo_StatInfo(PyObject *o) { #if CYTHON_USE_TP_FINALIZE - if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -2491,7 +2525,7 @@ static PyTypeObject __pyx_type_4ssh2_8statinfo_StatInfo = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -2596,7 +2630,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { } static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -2848,7 +2882,7 @@ if (!__Pyx_RefNanny) { Py_INCREF(__pyx_b); __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_cython_runtime); - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) @@ -3209,17 +3243,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } PyErr_SetObject(type, value); if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - 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 +#if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { @@ -3227,6 +3251,12 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); #endif } bad: @@ -3464,7 +3494,7 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK -static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { +static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON @@ -3925,7 +3955,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -4121,7 +4151,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } diff --git a/ssh2/utils.c b/ssh2/utils.c index c85119ba..3e01f0a1 100644 --- a/ssh2/utils.c +++ b/ssh2/utils.c @@ -1,4 +1,38 @@ -/* Generated by Cython 0.29.32 */ +/* Generated by Cython 0.29.36 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "libssh2/include/libssh2.h", + "ssh2/ext/find_eol.h" + ], + "extra_compile_args": [ + "-O2" + ], + "include_dirs": [ + "./ssh2", + "ssh2", + "libssh2/include" + ], + "libraries": [ + "ssh2" + ], + "library_dirs": [ + "/home/jake/Programming/ssh2-python/build_dir/src" + ], + "name": "ssh2.utils", + "runtime_library_dirs": [ + "$ORIGIN/." + ], + "sources": [ + "ssh2/utils.pyx", + "ssh2/ext/find_eol.c" + ] + }, + "module_name": "ssh2.utils" +} +END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN @@ -9,8 +43,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_32" -#define CYTHON_HEX_VERSION 0x001D20F0 +#define CYTHON_ABI "0_29_36" +#define CYTHON_HEX_VERSION 0x001D24F0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -78,16 +112,20 @@ #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900) + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 @@ -202,8 +240,8 @@ #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 - #elif !defined(CYTHON_USE_PYLONG_INTERNALS) && (PY_VERSION_HEX < 0x030C00A6) - #define CYTHON_USE_PYLONG_INTERNALS 1 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5) #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 @@ -229,7 +267,7 @@ #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 - #elif !defined(CYTHON_FAST_THREAD_STATE) && (PY_VERSION_HEX < 0x030C00A6) + #elif !defined(CYTHON_FAST_THREAD_STATE) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL @@ -242,7 +280,7 @@ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5)) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK @@ -365,9 +403,6 @@ #endif #endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define Py_OptimizeFlag 0 -#endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 @@ -445,6 +480,11 @@ #endif #define __Pyx_DefaultClassType PyType_Type #endif +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif @@ -552,11 +592,11 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 - #if defined(PyUnicode_IS_READY) - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) #else - #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) @@ -565,14 +605,14 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) - #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) - #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) - #endif + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif #endif #else #define CYTHON_PEP393_ENABLED 0 @@ -1105,18 +1145,18 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS -#define __Pyx_GetModuleGlobalName(var, name) {\ +#define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} -#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ +} while(0) +#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} +} while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) @@ -1248,14 +1288,22 @@ static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* TypeImport.proto */ -#ifndef __PYX_HAVE_RT_ImportType_proto -#define __PYX_HAVE_RT_ImportType_proto -enum __Pyx_ImportType_CheckSize { - __Pyx_ImportType_CheckSize_Error = 0, - __Pyx_ImportType_CheckSize_Warn = 1, - __Pyx_ImportType_CheckSize_Ignore = 2 +#ifndef __PYX_HAVE_RT_ImportType_proto_0_29_36 +#define __PYX_HAVE_RT_ImportType_proto_0_29_36 +#if __STDC_VERSION__ >= 201112L +#include +#endif +#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L +#define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) alignof(s) +#else +#define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) sizeof(void*) +#endif +enum __Pyx_ImportType_CheckSize_0_29_36 { + __Pyx_ImportType_CheckSize_Error_0_29_36 = 0, + __Pyx_ImportType_CheckSize_Warn_0_29_36 = 1, + __Pyx_ImportType_CheckSize_Ignore_0_29_36 = 2 }; -static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_0_29_36 check_size); #endif /* Import.proto */ @@ -1573,7 +1621,7 @@ static PyObject *__pyx_f_4ssh2_5utils_to_bytes(PyObject *__pyx_v__str) { * return _str.encode(ENCODING) */ __Pyx_XDECREF(__pyx_r); - if (!(likely(PyBytes_CheckExact(__pyx_v__str))||((__pyx_v__str) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v__str)->tp_name), 0))) __PYX_ERR(0, 32, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_v__str))||((__pyx_v__str) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v__str)->tp_name), 0))) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_INCREF(__pyx_v__str); __pyx_r = ((PyObject*)__pyx_v__str); goto __pyx_L0; @@ -1626,7 +1674,7 @@ static PyObject *__pyx_f_4ssh2_5utils_to_bytes(PyObject *__pyx_v__str) { if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 34, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 34, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; @@ -1648,7 +1696,7 @@ static PyObject *__pyx_f_4ssh2_5utils_to_bytes(PyObject *__pyx_v__str) { * */ __Pyx_XDECREF(__pyx_r); - if (!(likely(PyBytes_CheckExact(__pyx_v__str))||((__pyx_v__str) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v__str)->tp_name), 0))) __PYX_ERR(0, 35, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_v__str))||((__pyx_v__str) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v__str)->tp_name), 0))) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_INCREF(__pyx_v__str); __pyx_r = ((PyObject*)__pyx_v__str); goto __pyx_L0; @@ -4423,7 +4471,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { } static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) @@ -4492,10 +4540,8 @@ static int __Pyx_modinit_type_import_code(void) { /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule("ssh2.session"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_4ssh2_7session_Session = __Pyx_ImportType(__pyx_t_1, "ssh2.session", "Session", sizeof(struct __pyx_obj_4ssh2_7session_Session), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_7session_Session) __PYX_ERR(1, 19, __pyx_L1_error) - __pyx_ptype_4ssh2_7session_MethodType = __Pyx_ImportType(__pyx_t_1, "ssh2.session", "MethodType", sizeof(struct __pyx_obj_4ssh2_7session_MethodType), __Pyx_ImportType_CheckSize_Warn); - if (!__pyx_ptype_4ssh2_7session_MethodType) __PYX_ERR(1, 26, __pyx_L1_error) + __pyx_ptype_4ssh2_7session_Session = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.session", "Session", sizeof(struct __pyx_obj_4ssh2_7session_Session), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_7session_Session),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_7session_Session) __PYX_ERR(1, 19, __pyx_L1_error) + __pyx_ptype_4ssh2_7session_MethodType = __Pyx_ImportType_0_29_36(__pyx_t_1, "ssh2.session", "MethodType", sizeof(struct __pyx_obj_4ssh2_7session_MethodType), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(struct __pyx_obj_4ssh2_7session_MethodType),__Pyx_ImportType_CheckSize_Warn_0_29_36); if (!__pyx_ptype_4ssh2_7session_MethodType) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -4688,7 +4734,7 @@ if (!__Pyx_RefNanny) { Py_INCREF(__pyx_b); __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_cython_runtime); - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) @@ -5376,7 +5422,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { return __Pyx_PyFunction_FastCall(func, NULL, 0); } #endif -#ifdef __Pyx_CyFunction_USED +#if defined(__Pyx_CyFunction_USED) && defined(NDEBUG) if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) #else if (likely(PyCFunction_Check(func))) @@ -5551,17 +5597,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } PyErr_SetObject(type, value); if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - 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 +#if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { @@ -5569,6 +5605,12 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); #endif } bad: @@ -5578,16 +5620,18 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject #endif /* TypeImport */ -#ifndef __PYX_HAVE_RT_ImportType -#define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, - size_t size, enum __Pyx_ImportType_CheckSize check_size) +#ifndef __PYX_HAVE_RT_ImportType_0_29_36 +#define __PYX_HAVE_RT_ImportType_0_29_36 +static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject *module, const char *module_name, const char *class_name, + size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_0_29_36 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; + Py_ssize_t itemsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; + PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) @@ -5600,6 +5644,7 @@ static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; + itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) @@ -5609,22 +5654,37 @@ static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; + py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); + if (!py_itemsize) + goto bad; + itemsize = PyLong_AsSsize_t(py_itemsize); + Py_DECREF(py_itemsize); + py_itemsize = 0; + if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; #endif - if ((size_t)basicsize < size) { + if (itemsize) { + if (size % alignment) { + alignment = size % alignment; + } + if (itemsize < (Py_ssize_t)alignment) + itemsize = (Py_ssize_t)alignment; + } + if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } - if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + if (check_size == __Pyx_ImportType_CheckSize_Error_0_29_36 && (size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } - else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + else if (check_size == __Pyx_ImportType_CheckSize_Warn_0_29_36 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", @@ -5719,7 +5779,7 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK -static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { +static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON @@ -6028,7 +6088,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -6300,7 +6360,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; }