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

Fix spawners for python3.6 #1366

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

christophfroehlich
Copy link
Contributor

@christophfroehlich christophfroehlich commented Feb 2, 2024

#683 introduced an incompatibility with python 3.6, see this test.

python 3.6 is the minimum requirement for humble and default on rhel 8.

copilot told me:

The code you've provided is written in Python and uses the "walrus operator" (:=), which is a feature introduced in Python 3.8. This operator is used for assignment expressions. It assigns values to variables as part of a larger expression.The line of code where your cursor is located:

if result := function():

is using this operator. If you're seeing a syntax error, it's likely because you're using a version of Python that is older than 3.8.To fix this, you can either upgrade your Python version to 3.8 or later, or you can refactor the code to not use the walrus operator. Here's how you could refactor it:

result = function()
if result:

This will work in Python versions prior to 3.8.

Copy link

codecov bot commented Feb 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4409e77) 31.03% compared to head (16b854a) 31.03%.

Additional details and impacted files
@@           Coverage Diff           @@
##           humble    #1366   +/-   ##
=======================================
  Coverage   31.03%   31.03%           
=======================================
  Files          95       95           
  Lines       10729    10729           
  Branches     7421     7421           
=======================================
  Hits         3330     3330           
  Misses        723      723           
  Partials     6676     6676           
Flag Coverage Δ
unittests 31.03% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Member

@saikishor saikishor left a comment

Choose a reason for hiding this comment

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

The failing jobs didn't seem to be related! LGTM

@destogl destogl merged commit 6608dbc into ros-controls:humble Feb 2, 2024
13 of 16 checks passed
@christophfroehlich christophfroehlich deleted the fix_python36 branch February 5, 2024 08:26
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