diff options
author | Andrew Bartlett <abartlet@samba.org> | 2019-06-15 23:14:49 +1200 |
---|---|---|
committer | Noel Power <npower@samba.org> | 2019-06-24 18:48:53 +0000 |
commit | 4f32983ea8a24466165c043a73cb47b4073da15f (patch) | |
tree | d2cca7ffc2fc9005637006a18e0e648f197629f5 /libcli | |
parent | f32779b198258da5b28cad6e810e4017c9f6dbc9 (diff) | |
download | samba-4f32983ea8a24466165c043a73cb47b4073da15f.tar.gz |
py3: Remove duplicated PyUnicode_Check() after the py3 compat macros were removed
This came about because in py2 we had to check for strings and unicode.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Mon Jun 24 18:48:53 UTC 2019 on sn-devel-184
Diffstat (limited to 'libcli')
-rw-r--r-- | libcli/nbt/pynbt.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libcli/nbt/pynbt.c b/libcli/nbt/pynbt.c index c440ec933c4..a562f6dcb5e 100644 --- a/libcli/nbt/pynbt.c +++ b/libcli/nbt/pynbt.c @@ -57,7 +57,7 @@ static PyObject *py_nbt_node_init(PyTypeObject *self, PyObject *args, PyObject * static bool PyObject_AsDestinationTuple(PyObject *obj, const char **dest_addr, uint16_t *dest_port) { - if (PyUnicode_Check(obj) || PyUnicode_Check(obj)) { + if (PyUnicode_Check(obj)) { *dest_addr = PyUnicode_AsUTF8(obj); *dest_port = NBT_NAME_SERVICE_PORT; return true; @@ -69,7 +69,7 @@ static bool PyObject_AsDestinationTuple(PyObject *obj, const char **dest_addr, u return false; } - if (!(PyUnicode_Check(PyTuple_GetItem(obj, 0)) || PyUnicode_Check(PyTuple_GetItem(obj, 0)))) { + if (!PyUnicode_Check(PyTuple_GetItem(obj, 0))) { PyErr_SetString(PyExc_TypeError, "Destination tuple first element not string"); return false; } @@ -126,7 +126,7 @@ static bool PyObject_AsNBTName(PyObject *obj, struct nbt_name_socket *name_socke } } - if (PyUnicode_Check(obj) || PyUnicode_Check(obj)) { + if (PyUnicode_Check(obj)) { /* FIXME: Parse string to be able to interpret things like RHONWYN<02> ? */ name->name = PyUnicode_AsUTF8(obj); if (name->name == NULL) { |