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

Python 3 compatibility changes #42

Merged
merged 4 commits into from
Dec 31, 2015
Merged

Conversation

jonbinney
Copy link
Contributor

I've tried these with python 2.7 also to make sure they don't break backwards compatibility

  • except Exception, foo syntax is now except Exception as foo
  • all imports are now absolute
  • Dict.iteritems no longer exists in python3 (replaced with a lazy Dict.items)

@@ -61,7 +61,8 @@
g_goal_id = 1

def get_name_of_constant(C, n):
for k,v in C.__dict__.iteritems():
for k in C.__dict__:
v = C.__dict__[k]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you use the key and the value anyway you could just call .items().

@esteve
Copy link
Member

esteve commented Dec 29, 2015

@jonbinney thanks! Could you make the change to __dict__.iteritems()? I'll merge this PR.

Thanks.

@jonbinney
Copy link
Contributor Author

Thanks guys! I've updated the change to __dict__.iteritems()

@esteve
Copy link
Member

esteve commented Dec 31, 2015

@jonbinney thanks for updating the PR!

esteve added a commit that referenced this pull request Dec 31, 2015
Python 3 compatibility changes
@esteve esteve merged commit b90047e into ros:indigo-devel Dec 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants