Skip to content
Snippets Groups Projects
Commit af0076f4 authored by Spencer Thiel's avatar Spencer Thiel
Browse files

Python 3 compatibility in crio

parent 3c46b65d
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
"""PDS construction record input and output""" """PDS construction record input and output"""
import ctypes as c import ctypes as c
import numbers
from edosl0util.headers import BaseStruct, DaySegmentedTimecode from edosl0util.headers import BaseStruct, DaySegmentedTimecode
...@@ -50,8 +51,7 @@ def read(cr_file): ...@@ -50,8 +51,7 @@ def read(cr_file):
def read_struct(f, struct): def read_struct(f, struct):
rv = struct_to_dict(struct.from_buffer_copy(f.read(c.sizeof(struct)))) rv = struct_to_dict(struct.from_buffer_copy(f.read(c.sizeof(struct))))
rv = {k: v for k, v in rv.items() if not k.startswith('spare_')} # no spare fields rv = {k: v for k, v in rv.items() if not k.startswith('spare_')} # no spare fields
return {k: int(v) if isinstance(v, long) else v for k, v in rv.items()} # no longs return {k: int(v) if isinstance(v, numbers.Integral) else v for k, v in rv.items()} # no longs
return main() return main()
......
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