diff options
author | Jelmer Vernooij <jelmer@jelmer.uk> | 2016-07-24 18:04:16 +0000 |
---|---|---|
committer | Jelmer Vernooij <jelmer@jelmer.uk> | 2016-07-24 18:04:16 +0000 |
commit | a4766ce3bd70e212f18a691c530b0cb8002d662a (patch) | |
tree | 2f6aef799e1fdabf20b2560bdf55b96e60c3fbca /subvertpy/wc.c | |
parent | a11c569858b50fb7314bb80b9ea8f32fae5c3691 (diff) |
Add (mostly) Python3 support.
Diffstat (limited to 'subvertpy/wc.c')
-rw-r--r-- | subvertpy/wc.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/subvertpy/wc.c b/subvertpy/wc.c index 24cbb815..be9a8d71 100644 --- a/subvertpy/wc.c +++ b/subvertpy/wc.c @@ -2445,13 +2445,19 @@ static PyObject *set_adm_dir(PyObject *self, PyObject *args) { apr_pool_t *temp_pool; char *name; + PyObject *py_name; - if (!PyArg_ParseTuple(args, "s", &name)) + if (!PyArg_ParseTuple(args, "O", &py_name)) return NULL; temp_pool = Pool(NULL); if (temp_pool == NULL) return NULL; + name = py_object_to_svn_string(py_name, temp_pool); + if (name == NULL) { + apr_pool_destroy(temp_pool); + return NULL; + } RUN_SVN_WITH_POOL(temp_pool, svn_wc_set_adm_dir(name, temp_pool)); apr_pool_destroy(temp_pool); Py_RETURN_NONE; @@ -2462,14 +2468,22 @@ static PyObject *get_pristine_copy_path(PyObject *self, PyObject *args) apr_pool_t *pool; const char *pristine_path; char *path; + PyObject *py_path; PyObject *ret; - if (!PyArg_ParseTuple(args, "s", &path)) + if (!PyArg_ParseTuple(args, "O", &py_path)) return NULL; pool = Pool(NULL); if (pool == NULL) return NULL; + + path = py_object_to_svn_string(py_path, pool); + if (path == NULL) { + apr_pool_destroy(pool); + return NULL; + } + PyErr_WarnEx(PyExc_DeprecationWarning, "get_pristine_copy_path is deprecated. Use get_pristine_contents instead.", 2); RUN_SVN_WITH_POOL(pool, svn_wc_get_pristine_copy_path(svn_dirent_canonicalize(path, pool), |