osmith submitted this change.

View Change



2 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.

Approvals: fixeria: Looks good to me, but someone else must approve pespin: Looks good to me, approved osmith: Verified laforge: Looks good to me, approved
Fix lint errors: avoid equality comparisons to `False`

src/osmocom/utils.py:150:8: E712 Avoid equality comparisons to `False`; use `if not signed:` for false checks
|
148 | """
149 |
150 | if signed == False and number < 0:
| ^^^^^^^^^^^^^^^ E712
151 | raise ValueError("expecting a positive number")
|
= help: Replace with `not signed`

Change-Id: I2ebb33c498b4a7e6229980462aa51b579fa4f782
---
M src/osmocom/utils.py
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/osmocom/utils.py b/src/osmocom/utils.py
index 3991da2..7963c05 100644
--- a/src/osmocom/utils.py
+++ b/src/osmocom/utils.py
@@ -147,7 +147,7 @@
Integer 'nbytes', which is the number of bytes required to encode 'number'
"""

- if signed == False and number < 0:
+ if not signed and number < 0:
raise ValueError("expecting a positive number")

# Compute how many bytes we need for the absolute (positive) value of the given number

To view, visit change 41385. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: python/pyosmocom
Gerrit-Branch: master
Gerrit-Change-Id: I2ebb33c498b4a7e6229980462aa51b579fa4f782
Gerrit-Change-Number: 41385
Gerrit-PatchSet: 3
Gerrit-Owner: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>