← Back to team overview

subvertpy-users team mailing list archive

[PATCH] Fix Python 2.4 compatibility

 

# HG changeset patch
# User Dan Villiom Podlaski Christiansen <danchr@xxxxxxxxx>
# Date 1285353940 -7200
# Node ID a8abf2a5ddc82a7f9e8d079523a64fc53ea17ff2
# Parent  f223a3e079a3d1b5f840612823f0b27448a2b6f0
Fix Python 2.4 compatibility.

diff --git a/subvertpy/wc.c b/subvertpy/wc.c
--- a/subvertpy/wc.c
+++ b/subvertpy/wc.c
@@ -1170,7 +1170,11 @@ static PyObject *get_pristine_copy_path(
 	pool = Pool(NULL);
 	if (pool == NULL)
 		return NULL;
+#if PY_VERSION_HEX < 0x02050000
+	PyErr_Warn(PyExc_DeprecationWarning, "get_pristine_copy_path is deprecated. Use get_pristine_contents instead.");
+#else
 	PyErr_WarnEx(PyExc_DeprecationWarning, "get_pristine_copy_path is deprecated. Use get_pristine_contents instead.", 2);
+#endif
 	RUN_SVN_WITH_POOL(pool, svn_wc_get_pristine_copy_path(svn_path_canonicalize(path, pool), &pristine_path, pool));
 	ret = PyString_FromString(pristine_path);
 	apr_pool_destroy(pool);



Follow ups