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

Small fixes for modern flake8. #1264

Merged
merged 1 commit into from
Mar 26, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rclpy/rclpy/parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def parameter_dict_from_yaml_file(

for n in param_keys:
value = param_file[n]
if type(value) != dict or 'ros__parameters' not in value:
if not isinstance(value, dict) or 'ros__parameters' not in value:
raise RuntimeError(f'YAML file is not a valid ROS parameter file for node {n}')
param_dict.update(value['ros__parameters'])
return _unpack_parameter_dict(namespace, param_dict)
Expand All @@ -337,7 +337,7 @@ def _unpack_parameter_dict(namespace, parameter_dict):
for param_name, param_value in parameter_dict.items():
full_param_name = namespace + param_name
# Unroll nested parameters
if type(param_value) == dict:
if isinstance(param_value, dict):
parameters.update(_unpack_parameter_dict(
namespace=full_param_name + PARAMETER_SEPARATOR_STRING,
parameter_dict=param_value))
Expand Down
2 changes: 1 addition & 1 deletion rclpy/test/test_logging_rosout.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def test_enable_rosout(

if expected_data:
assert (rosout_subscription_msg is not None)
assert (type(rosout_subscription_msg) == Log)
assert (isinstance(rosout_subscription_msg, Log))
assert (LoggingSeverity(rosout_subscription_msg.level) == LoggingSeverity.INFO)
assert (len(rosout_subscription_msg.msg) != 0)
assert (rosout_subscription_msg.msg == message_data)
Expand Down