Skip to content

Commit

Permalink
Removed fix if python3
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcin Lubimow committed Jul 6, 2016
1 parent 61a728b commit 7ccbd53
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pudb/remote.py
Expand Up @@ -69,11 +69,19 @@ def __init__(self, host=PUDB_RDB_HOST, port=PUDB_RDB_PORT,
# makefile ignores encoding if there's no buffering.
raw_sock_file = self._client.makefile("rwb", 0)
import codecs
sock_file = codecs.StreamRecoder(raw_sock_file,

if sys.version_info[0] < 3:
sock_file = codecs.StreamRecoder(
raw_sock_file,
codecs.getencoder("utf-8"),
codecs.getdecoder("utf-8"),
codecs.getreader("utf-8"),
codecs.getwriter("utf-8"))
else:
sock_file = codecs.StreamReaderWriter(
raw_sock_file,
codecs.getreader("utf-8"),
codecs.getwriter("utf-8"))

self._handle = sys.stdin = sys.stdout = sock_file

Expand Down

0 comments on commit 7ccbd53

Please sign in to comment.