diff options
author | Andrew Bartlett <abartlet@samba.org> | 2019-06-07 10:45:52 +0200 |
---|---|---|
committer | Noel Power <npower@samba.org> | 2019-06-24 17:24:27 +0000 |
commit | 34f9a089d8d3a8971b2f7ee45f6d8e823a52a193 (patch) | |
tree | e82a39e5c36f4c9fc1ec7074f82ead6d9221315a /source4/librpc | |
parent | f498c819664e9df658651d39f616f5b4d62b4750 (diff) | |
download | samba-34f9a089d8d3a8971b2f7ee45f6d8e823a52a193.tar.gz |
py3: Remove PyStr_FromString() compatability macro
We no longer need Samba to be py2/py3 compatible so we choose to return to the standard
function names.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
Diffstat (limited to 'source4/librpc')
-rw-r--r-- | source4/librpc/ndr/py_lsa.c | 6 | ||||
-rw-r--r-- | source4/librpc/ndr/py_misc.c | 2 | ||||
-rw-r--r-- | source4/librpc/ndr/py_security.c | 6 | ||||
-rw-r--r-- | source4/librpc/rpc/pyrpc.c | 2 | ||||
-rw-r--r-- | source4/librpc/rpc/pyrpc_util.c | 2 |
5 files changed, 9 insertions, 9 deletions
diff --git a/source4/librpc/ndr/py_lsa.c b/source4/librpc/ndr/py_lsa.c index f9857a56957..fe01de36fea 100644 --- a/source4/librpc/ndr/py_lsa.c +++ b/source4/librpc/ndr/py_lsa.c @@ -26,9 +26,9 @@ static PyObject *py_lsa_String_str(PyObject *py_self) PyObject *ret = NULL; if (self->string == NULL) { const char *empty = ""; - ret = PyStr_FromString(empty); + ret = PyUnicode_FromString(empty); } else { - ret = PyStr_FromString(self->string); + ret = PyUnicode_FromString(self->string); } return ret; } @@ -39,7 +39,7 @@ static PyObject *py_lsa_String_repr(PyObject *py_self) PyObject *ret = NULL; if (self->string == NULL) { const char *empty = "lsaString(None)"; - ret = PyStr_FromString(empty); + ret = PyUnicode_FromString(empty); } else { ret = PyStr_FromFormat("lsaString('%s')", self->string); } diff --git a/source4/librpc/ndr/py_misc.c b/source4/librpc/ndr/py_misc.c index 187fdb784cf..5e6af484f26 100644 --- a/source4/librpc/ndr/py_misc.c +++ b/source4/librpc/ndr/py_misc.c @@ -69,7 +69,7 @@ static PyObject *py_GUID_str(PyObject *py_self) { struct GUID *self = pytalloc_get_ptr(py_self); char *str = GUID_string(NULL, self); - PyObject *ret = PyStr_FromString(str); + PyObject *ret = PyUnicode_FromString(str); talloc_free(str); return ret; } diff --git a/source4/librpc/ndr/py_security.c b/source4/librpc/ndr/py_security.c index ecac43bb258..b9dd29310e6 100644 --- a/source4/librpc/ndr/py_security.c +++ b/source4/librpc/ndr/py_security.c @@ -116,7 +116,7 @@ static PyObject *py_dom_sid_str(PyObject *py_self) { struct dom_sid *self = pytalloc_get_ptr(py_self); struct dom_sid_buf buf; - PyObject *ret = PyStr_FromString(dom_sid_str_buf(self, &buf)); + PyObject *ret = PyUnicode_FromString(dom_sid_str_buf(self, &buf)); return ret; } @@ -285,7 +285,7 @@ static PyObject *py_descriptor_as_sddl(PyObject *self, PyObject *args) text = sddl_encode(NULL, desc, sid); - ret = PyStr_FromString(text); + ret = PyUnicode_FromString(text); talloc_free(text); @@ -438,7 +438,7 @@ static PyObject *py_privilege_name(PyObject *self, PyObject *args) if (!PyArg_ParseTuple(args, "i", &priv)) return NULL; - return PyStr_FromString(sec_privilege_name(priv)); + return PyUnicode_FromString(sec_privilege_name(priv)); } static PyObject *py_privilege_id(PyObject *self, PyObject *args) diff --git a/source4/librpc/rpc/pyrpc.c b/source4/librpc/rpc/pyrpc.c index 90c890d2a0c..067dadf54a2 100644 --- a/source4/librpc/rpc/pyrpc.c +++ b/source4/librpc/rpc/pyrpc.c @@ -95,7 +95,7 @@ static PyObject *py_iface_server_name(PyObject *obj, void *closure) if (server_name == NULL) Py_RETURN_NONE; - return PyStr_FromString(server_name); + return PyUnicode_FromString(server_name); } static PyObject *py_ndr_syntax_id(struct ndr_syntax_id *syntax_id) diff --git a/source4/librpc/rpc/pyrpc_util.c b/source4/librpc/rpc/pyrpc_util.c index e6227eaa604..0d6a16518f1 100644 --- a/source4/librpc/rpc/pyrpc_util.c +++ b/source4/librpc/rpc/pyrpc_util.c @@ -416,7 +416,7 @@ PyObject *PyString_FromStringOrNULL(const char *str) if (str == NULL) { Py_RETURN_NONE; } - return PyStr_FromString(str); + return PyUnicode_FromString(str); } PyObject *pyrpc_import_union(PyTypeObject *type, TALLOC_CTX *mem_ctx, int level, |