Skip to content

Commit 7a31fb8

Browse files
pdgendtSeppoTakalo
authored andcommitted
[nrf fromtree] tests: net: lib: lwm2m: interop: Fix strip-with-multi-characters (B005)
All strip functions remove any of the provided characters instead of a prefix/suffix. This is likely a bug. See https://docs.astral.sh/ruff/rules/strip-with-multi-characters/ Signed-off-by: Pieter De Gendt <[email protected]> (cherry picked from commit 175bfb4)
1 parent 6673a56 commit 7a31fb8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/net/lib/lwm2m/interop/pytest/leshan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ def next_event(self, event: str):
455455
for line in self._it:
456456
if not line.startswith('data: '):
457457
continue
458-
data = json.loads(line.lstrip('data: '))
458+
data = json.loads(line.removeprefix('data: '))
459459
if event == 'SEND' or (event == 'NOTIFICATION' and data['kind'] == 'composite'):
460460
return Leshan.parse_composite(data['val'])
461461
if event == 'NOTIFICATION':

0 commit comments

Comments
 (0)