Skip to content

Conversation

@bsb808
Copy link

@bsb808 bsb808 commented Sep 2, 2021

Should fix the bug discovered when running the example for Dave PR: Field-Robotics-Lab/dave#149

If the future import is not at the beginning of the file, a SyntaxError is raised:

$ ./gripper_controller.py 
Traceback (most recent call last):
  File "./gripper_controller.py", line 18, in <module>
    from uuv_manipulator_interfaces import GripperInterface
  File "/home/bsb/uuv_ws/devel/lib/python3/dist-packages/uuv_manipulator_interfaces/__init__.py", line 34, in <module>
    exec(__fh.read())
  File "<string>", line 17, in <module>
  File "/home/bsb/uuv_ws/src/uuv_manipulators/uuv_manipulators_kinematics/src/uuv_manipulator_interfaces/gripper.py", line 25
    from __future__ import division
    ^
SyntaxError: from __future__ imports must occur at the beginning of the file

@M1chaelM
Copy link

M1chaelM commented Sep 2, 2021

This PR is a duplicate of #4 (contributed by a community member), so we should close that one after merging this. I added another small tweak to update to Python3 syntax, just in the interest of reducing the total number of PRs.

Copy link

@mabelzhang mabelzhang left a comment

Choose a reason for hiding this comment

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

This works for me! Thank you!

@mabelzhang
Copy link

Extra steps, but if we want to keep the earlier contribution from #4, we could merge #4, merge master into this PR, and then merge this.

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.

3 participants