Skip to content

[ENH]: Python 3 compatibility #1

@asreimer

Description

@asreimer

Currently, this codebase doesn't work out of the box on Python 3. For example, here's an issue with using Python 3 that needs to be resolved:

IndexError                                Traceback (most recent call last)
<ipython-input-2-d43f080fc2af> in <module>
----> 1 pgc = ParseGenConfig('example_registers.txt')

~/venvs/py37/lib/python3.7/site-packages/igntcbb/ParseGenConfig.py in __init__(self, filename)
     22         self.filename = filename
     23 
---> 24         registers, custom_types = self.parse()
     25 
     26         self.registers = registers

~/venvs/py37/lib/python3.7/site-packages/igntcbb/ParseGenConfig.py in parse(self)
     82         while parsing_custom_types:
     83             # look for the next custom type definition
---> 84             new_custom_type, new_line_num = self.find_and_parse_type(line_num, contents)
     85             line_num = new_line_num
     86 

~/venvs/py37/lib/python3.7/site-packages/igntcbb/ParseGenConfig.py in find_and_parse_type(self, line_num, contents)
    200             line1 = contents[line_num].replace('\r','')[0:11]
    201             line2 = contents[line_num+3].replace('\r\n','')
--> 202             line3 = contents[line_num+4].replace('\r','')[0:11]
    203 
    204             if (line1 == '-----------') and (line2 in valid_headers) and (line3 == '-----------'):

IndexError: list index out of range

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions