From 5cc36158b1787d766265d748ee2bbe3beebee0f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Cal=C3=A1bkov=C3=A1?= Date: Fri, 7 Jun 2024 16:04:44 +0200 Subject: [PATCH] Drop python-six dependency --- sasl/saslwrapper.pyx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sasl/saslwrapper.pyx b/sasl/saslwrapper.pyx index ef5ab7e..f754e38 100644 --- a/sasl/saslwrapper.pyx +++ b/sasl/saslwrapper.pyx @@ -14,8 +14,6 @@ #cython: language_level=3 -from six import string_types, PY3 - from libcpp cimport bool from libc.stdint cimport uint32_t from libcpp.string cimport string as string_t @@ -36,7 +34,7 @@ cdef extern from 'saslwrapper.h' namespace 'saslwrapper': cpdef string_t to_bytes(bytes_or_str): - if PY3 and isinstance(bytes_or_str, string_types): + if isinstance(bytes_or_str, str): return bytes_or_str.encode('utf-8') return bytes_or_str @@ -53,7 +51,7 @@ cdef class Client: cpdef setAttr(self, key, value): if isinstance(value, int): return self._this.setAttr(to_bytes(key), value) - elif isinstance(value, string_types): + elif isinstance(value, str): return self._this.setAttr(to_bytes(key), to_bytes(value)) cpdef init(self):