Commit e028cf28 authored by Kirill Smelkov's avatar Kirill Smelkov

golang: qq: Don't depend on six

Just use builtins and cimported things that we have at pyx level.
parent 3073ac98
......@@ -770,7 +770,6 @@ cdef DType parse_dtype(dtype) except <DType>-1:
# ---- strings ----
from golang import strconv as pystrconv
import six
def pyb(s): # -> bytes
"""b converts str/unicode/bytes s to UTF-8 encoded bytestring.
......@@ -821,14 +820,14 @@ def pyqq(obj):
# make sure obj is text | bytes
# py2: unicode | str
# py3: str | bytes
if not isinstance(obj, (six.text_type, six.binary_type)):
if not isinstance(obj, (unicode, bytes)):
obj = str(obj)
qobj = pystrconv.quote(obj)
# `printf('%s', qq(obj))` should work. For this make sure qobj is always a
# str - not bytes under py3 (if it was bytes it will print e.g. as b'...')
if six.PY3:
qobj = pyu(qobj)
return qobj
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment