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

Test for equality to None with 'is' instead of '==' #355

Merged
merged 5 commits into from Jan 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions tf2_ros/src/tf2_ros/buffer_client.py
Expand Up @@ -177,9 +177,9 @@ def __process_goal(self, goal):
return self.__process_result(self.client.get_result())

def __process_result(self, result):
if result == None:
if not result:
raise tf2.TransformException("The BufferServer returned None for result! Something is likely wrong with the server.")
if result.error == None:
if not result.error:
raise tf2.TransformException("The BufferServer returned None for result.error! Something is likely wrong with the server.")
if result.error.error != result.error.NO_ERROR:
if result.error.error == result.error.LOOKUP_ERROR:
Expand Down
4 changes: 2 additions & 2 deletions tf2_ros/src/tf2_ros/buffer_interface.py
Expand Up @@ -65,7 +65,7 @@ def transform(self, object_stamped, target_frame, timeout=rospy.Duration(0.0), n
do_transform = self.registration.get(type(object_stamped))
res = do_transform(object_stamped, self.lookup_transform(target_frame, object_stamped.header.frame_id,
object_stamped.header.stamp, timeout))
if new_type == None:
if not new_type:
return res

return convert(res, new_type)
Expand Down Expand Up @@ -95,7 +95,7 @@ def transform_full(self, object_stamped, target_frame, target_time, fixed_frame,
res = do_transform(object_stamped, self.lookup_transform_full(target_frame, target_time,
object_stamped.header.frame_id, object_stamped.header.stamp,
fixed_frame, timeout))
if new_type == None:
if not new_type:
return res

return convert(res, new_type)
Expand Down