aboutsummaryrefslogtreecommitdiffstats
path: root/netlib
diff options
context:
space:
mode:
Diffstat (limited to 'netlib')
-rw-r--r--netlib/strutils.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/netlib/strutils.py b/netlib/strutils.py
index 414b2e57..cfcdf485 100644
--- a/netlib/strutils.py
+++ b/netlib/strutils.py
@@ -19,12 +19,12 @@ def native(s, *encoding_opts):
"""
if not isinstance(s, (six.binary_type, six.text_type)):
raise TypeError("%r is neither bytes nor unicode" % s)
- if six.PY3:
- if isinstance(s, six.binary_type):
- return s.decode(*encoding_opts)
- else:
+ if six.PY2:
if isinstance(s, six.text_type):
return s.encode(*encoding_opts)
+ else:
+ if isinstance(s, six.binary_type):
+ return s.decode(*encoding_opts)
return s