Skip to content

Commit

Permalink
Modernize Python 2 code to get ready for Python 3 (#928)
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss authored and dirk-thomas committed Mar 23, 2018
1 parent 38b85c6 commit f7f51e7
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 16 deletions.
4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'catkin.tex', ur'Catkin',
ur'troy d. straszheim', 'manual'),
('index', 'catkin.tex', r'Catkin',
r'troy d. straszheim', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down
5 changes: 2 additions & 3 deletions test/checks/fuerte/distro-to-install.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@

def go(argv):
if len(argv) != 2:
print 'wrong number args'
print('wrong number args')
sys.exit(1)

d=rospkg.distro.load_distro(argv[1])
ri=rospkg.distro.distro_to_rosinstall(d, 'release')
print ri
print(ri)

if __name__ == '__main__':
go(sys.argv)

2 changes: 1 addition & 1 deletion test/local_tests/test_with_mock_workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_noproject(self):

out = self.cmake(CMAKE_PREFIX_PATH=self.installdir,
expect=fail)
print("failed as expected, out=", out)
print("failed as expected, out={}".format(out))

self.assertTrue(b"catkin_package() PROJECT_NAME is set to 'Project'" in out, out)
# assert 'You must call project() with the same name before.' in out
Expand Down
6 changes: 2 additions & 4 deletions test/mock_resources/src/catkin_test/a/src/a/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@

s = std_msgs.msg.String()

print "<<< a >>>"
print type(s)


print("<<< a >>>")
print(type(s))
4 changes: 1 addition & 3 deletions test/mock_resources/src/catkin_test/b/src/b/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@
a = a.msg.AMsg()
b = b.msg.BMsg()

print "<<< b >>>"


print("<<< b >>>")
2 changes: 1 addition & 1 deletion test/mock_resources/src/catkin_test/c/src/c/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
print "IMPORTING"
print("IMPORTING")
2 changes: 1 addition & 1 deletion test/mock_resources/src/catkin_test/d/src/d/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
print "IMPORTING"
print("IMPORTING")
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

some_string = std_msgs.msg.String
some_string.data = "Some Data in a std_msgs.msg.String"
print (some_string.data)
print(some_string.data)

0 comments on commit f7f51e7

Please sign in to comment.