Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ros_introspection] Use str instead of unicode in replace_contents #91

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ros_introspection/src/ros_introspection/source_code_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ def get_contents(self):
def replace_contents(self, contents):
self.changed_contents = contents
try:
self.lines = map(unicode.strip, unicode(contents).split('\n'))
except NameError:
self.lines = map(str.strip, str(contents).split('\n'))
except (NameError, UnicodeDecodeError):
# Python3 Case
self.lines = list(map(str.strip, contents.split('\n')))

Expand Down