fix issue 2141: raw_input does not exist in python 3#2143
fix issue 2141: raw_input does not exist in python 3#2143jacobperron merged 2 commits intoros:noetic-develfrom
Conversation
Signed-off-by: Scherer Sebastian (CR/AAS3) <Sebastian.Scherer2@de.bosch.com>
tools/rosbag/scripts/makerule.py
Outdated
| try: | ||
| input = raw_input # Python 2.x: Simulate 3.x behavior. | ||
| except NameError: | ||
| pass # Python 3.x: There is no raw_input, use input directly. |
There was a problem hiding this comment.
Correct, on the noetic branch there's no need for the backwards compatibility. Some people use Python 3 with older ROS distros (like arch melodic users), so mabye @bst added it in hopes for a backport to melodic?
There was a problem hiding this comment.
Ah, i wasn't aware of that. thanks for pointing that out 👍
There was a problem hiding this comment.
Good point, I was actually not aware that we here do not need to support Python 2 anymore.
I have no preference in any direction. If you prefer I can also remove the workaround for supporting Python 2.
There was a problem hiding this comment.
I would remove the workaround here, and if there is desire to backport to Melodic, we can consider the workaround in a backport PR.
There was a problem hiding this comment.
agree. we would not want to keep something will never be used.
There was a problem hiding this comment.
Makes sense to me. I just removed the python2 compatibility workaround I had added before.
Signed-off-by: Scherer Sebastian (CR/AAS3) <Sebastian.Scherer2@de.bosch.com>
This fixes issue #2141 by using
input()instead ofraw_input()and simulating python 3's `input() for python 2.