Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
pygolang
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
pygolang
Commits
e028cf28
Commit
e028cf28
authored
Jan 29, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
golang: qq: Don't depend on six
Just use builtins and cimported things that we have at pyx level.
parent
3073ac98
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
golang/_golang.pyx
golang/_golang.pyx
+2
-3
No files found.
golang/_golang.pyx
View file @
e028cf28
...
...
@@ -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
.
PY
3
:
if
PY_MAJOR_VERSION
>=
3
:
qobj
=
pyu
(
qobj
)
return
qobj
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment