Skip to content

Commit

Permalink
Remove Python 2 handling of string encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
timonegk committed Aug 15, 2023
1 parent c6d284b commit 47bbbfa
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions catkin_tools/execution/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,6 @@

MAX_LOGFILE_HISTORY = 10

if type(u'') == str:
def _encode(string):
"""Encode a Python 3 str into bytes.
:type data: str
"""
return string.encode('utf-8')
else:
def _encode(string):
"""Encode a Python 2 str into bytes.
:type data: str
"""
return string.decode('utf-8').encode('utf-8')


class IOBufferContainer(object):

Expand Down Expand Up @@ -133,7 +120,7 @@ def _encode(data):
"""Encode a Python str into bytes.
:type data: str
"""
return _encode(data)
return data.encode('utf8')

@staticmethod
def _decode(data):
Expand Down

0 comments on commit 47bbbfa

Please sign in to comment.