Skip to content

Conversation

@cclauss
Copy link
Contributor

@cclauss cclauss commented Jul 14, 2025

flake8 rule F821 -- Undefined names have the potential to raise NameError at runtime.

import json needed for lines 64 and 106.
self needed for line 87.
Line 87 mistakenly used self.

Copy link
Contributor

@peterbarker peterbarker left a comment

Choose a reason for hiding this comment

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

Wrong fix. Should be using data['version'] not self.version.

.... this doesn't make any sense as a change as it's creating an objet and self makes no sense. I can't see how this could possibly have been tested.

@cclauss cclauss requested a review from peterbarker July 15, 2025 11:13
flake8 rule F821 -- Undefined names have the potential to raise NameError at runtime.

`import json` needed for lines 64 and 106.
`self` needed for line 87.
Copy link
Contributor

@peterbarker peterbarker left a comment

Choose a reason for hiding this comment

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

I might have moved to using f-string and a ValueError, but this is definitely better!

@peterbarker peterbarker merged commit 10b58b0 into ArduPilot:master Aug 6, 2025
2 checks passed
@peterbarker
Copy link
Contributor

Merged, thanks!

@cclauss cclauss deleted the patch-4 branch August 6, 2025 07:12
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.

2 participants