Created
November 5, 2019 11:16
-
-
Save jun66j5/96a6cd22d0e341bd2980fec3cf73524d to your computer and use it in GitHub Desktop.
Avoid deprecation warnings about PY_SSIZE_T_CLEAN since Python 3.8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c | |
=================================================================== | |
--- subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c (revision 1869386) | |
+++ subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c (working copy) | |
@@ -23,6 +23,8 @@ | |
/* Tell swigutil_py.h that we're inside the implementation */ | |
#define SVN_SWIG_SWIGUTIL_PY_C | |
+/* Avoid deprecation warnings about PY_SSIZE_T_CLEAN since Python 3.8 */ | |
+#define PY_SSIZE_T_CLEAN | |
#include <Python.h> | |
@@ -1990,7 +1992,7 @@ | |
#endif | |
ib->baton, name, | |
value ? value->data : NULL, | |
- value ? value->len : 0, | |
+ (Py_ssize_t) (value ? value->len : 0), | |
make_ob_pool, pool)) == NULL) | |
{ | |
err = callback_exception_error(); | |
@@ -2195,7 +2197,7 @@ | |
#endif | |
ib->baton, name, | |
value ? value->data : NULL, | |
- value ? value->len : 0, | |
+ (Py_ssize_t) (value ? value->len : 0), | |
make_ob_pool, pool)) == NULL) | |
{ | |
err = callback_exception_error(); | |
@@ -2432,7 +2434,8 @@ | |
#endif | |
ib->baton, name, | |
value ? value->data : NULL, | |
- value ? value->len : 0)) == NULL) | |
+ (Py_ssize_t) (value ? value->len : 0))) | |
+ == NULL) | |
{ | |
err = callback_exception_error(); | |
goto finished; | |
@@ -2467,7 +2470,8 @@ | |
#endif | |
ib->baton, name, | |
value ? value->data : NULL, | |
- value ? value->len : 0)) == NULL) | |
+ (Py_ssize_t) (value ? value->len : 0))) | |
+ == NULL) | |
{ | |
err = callback_exception_error(); | |
goto finished; | |
@@ -2802,7 +2806,7 @@ | |
svn_swig_py_acquire_py_lock(); | |
if ((result = PyObject_CallMethod(py_io, (char *)"write", | |
(char *) SVN_SWIG_BYTES_FMT "#", | |
- data, *len)) == NULL) | |
+ data, (Py_ssize_t) *len)) == NULL) | |
{ | |
err = callback_exception_error(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment