Skip to content

Commit

Permalink
tidy up py3compat
Browse files Browse the repository at this point in the history
  • Loading branch information
arekbulski committed Aug 23, 2016
1 parent 51beb5c commit d26b19c
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions construct/lib/py3compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@
#-------------------------------------------------------------------------------
import sys
PY3 = sys.version_info[0] == 3
from io import BytesIO, StringIO


if PY3:
import io
StringIO = io.StringIO
BytesIO = io.BytesIO

def bchr(i):
""" When iterating over b'...' in Python 2 you get single b'_' chars
and in Python 3 you get integers. Call bchr to always turn this
Expand Down Expand Up @@ -43,9 +40,6 @@ def decodebytes(b, encoding):
advance_iterator = next

else:
import cStringIO
StringIO = BytesIO = cStringIO.StringIO

int2byte = chr
byte2int = ord
bchr = lambda i: i
Expand Down

0 comments on commit d26b19c

Please sign in to comment.