aboutsummaryrefslogtreecommitdiffstats
path: root/tests/util/py3xfunctions.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/util/py3xfunctions.py')
-rw-r--r--tests/util/py3xfunctions.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/util/py3xfunctions.py b/tests/util/py3xfunctions.py
index 3b89867a6..4b8d80154 100644
--- a/tests/util/py3xfunctions.py
+++ b/tests/util/py3xfunctions.py
@@ -1,4 +1,6 @@
def b(s):
+ if type(s) == bytes:
+ return s
return bytes(s, "UTF8")
def buffer_(s):
@@ -6,6 +8,8 @@ def buffer_(s):
return None
elif type(s) == str:
return bytes(s, "UTF8")
+ elif type(s) == bytes:
+ return s
else:
memoryview(s)