diff options
author | Thomas Kriechbaumer <Kriechi@users.noreply.github.com> | 2016-07-09 10:17:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-09 10:17:24 +0200 |
commit | 695c7368e6e4474268df0319b78b9536bae9fe39 (patch) | |
tree | e93aa6bdd8dc8a7d3d9ff0babbe9e7c752cff45a /netlib/strutils.py | |
parent | 3d40fae6d759adc4d0862c52cb043cd3c9fa0cc8 (diff) | |
parent | 83a1cc5a9a62dbe22bd9e87f496928ae1664da2b (diff) | |
download | mitmproxy-695c7368e6e4474268df0319b78b9536bae9fe39.tar.gz mitmproxy-695c7368e6e4474268df0319b78b9536bae9fe39.tar.bz2 mitmproxy-695c7368e6e4474268df0319b78b9536bae9fe39.zip |
Merge pull request #1299 from dufferzafar/py3-dump
Python 3 - test_dump
Diffstat (limited to 'netlib/strutils.py')
-rw-r--r-- | netlib/strutils.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/netlib/strutils.py b/netlib/strutils.py index 9208f954..32e77927 100644 --- a/netlib/strutils.py +++ b/netlib/strutils.py @@ -57,8 +57,8 @@ def escape_control_characters(text, keep_spacing=True): Args: keep_spacing: If True, tabs and newlines will not be replaced. """ - # type: (six.text_type) -> six.text_type - if not isinstance(text, six.text_type): + # type: (six.string_types) -> six.text_type + if not isinstance(text, six.string_types): raise ValueError("text type must be unicode but is {}".format(type(text).__name__)) trans = _control_char_trans_newline if keep_spacing else _control_char_trans @@ -146,7 +146,7 @@ def hexdump(s): A generator of (offset, hex, str) tuples """ for i in range(0, len(s), 16): - offset = "{:0=10x}".format(i).encode() + offset = "{:0=10x}".format(i) part = s[i:i + 16] x = " ".join("{:0=2x}".format(i) for i in six.iterbytes(part)) x = x.ljust(47) # 16*2 + 15 |