Skip to content
Snippets Groups Projects
Unverified Commit ffdb5a54 authored by Dashie's avatar Dashie
Browse files

maybe encode only if bytes; also condition now unneeded

parent 52c429cd
No related branches found
No related tags found
No related merge requests found
...@@ -29,7 +29,7 @@ class PacketCommentPolicy(): ...@@ -29,7 +29,7 @@ class PacketCommentPolicy():
elif ("comment" in data): elif ("comment" in data):
comment = data["comment"] comment = data["comment"]
if isinstance(comment, str): if isinstance(comment, bytes):
comment = comment.encode('ascii', 'ignore') comment = comment.encode('ascii', 'ignore')
comment = comment.replace('\x00', '') comment = comment.replace('\x00', '')
......
...@@ -109,7 +109,7 @@ class PacketTelemetryRepository(Repository): ...@@ -109,7 +109,7 @@ class PacketTelemetryRepository(Repository):
newObject.bits = data["telemetry"]["bits"] newObject.bits = data["telemetry"]["bits"]
if ("seq" in data["telemetry"]): if ("seq" in data["telemetry"]):
if isinstance(data["telemetry"]["seq"], str) or isinstance(data["telemetry"]["seq"], str): if isinstance(data["telemetry"]["seq"], str):
try: try:
newObject.seq = int(data["telemetry"]["seq"], 10) newObject.seq = int(data["telemetry"]["seq"], 10)
except ValueError: except ValueError:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment