The conversion fails with the following error when you have trailing whitespace inside of an indentation block.
2018-05-08 12:24:04 - ERROR | [QtPyConvert.run]
Line 1
from PySide import QtGui
Traceback (most recent call last):
File "Q:\Tools\eng\bjarrett\qtpyconvert\venv\lib\site-packages\qt_py_convert\run.py", line 489, in run
red = redbaron.RedBaron(text)
File "Q:\Tools\eng\bjarrett\qtpyconvert\venv\lib\site-packages\redbaron\redbaron.py", line 36, in __init__
self.node_list = base_nodes.NodeList.from_fst(baron.parse(source_code), parent=self, on_attribute="root")
File "Q:\Tools\eng\bjarrett\qtpyconvert\venv\lib\site-packages\baron\baron.py", line 49, in parse
tokens = tokenize(source_code, False)
File "Q:\Tools\eng\bjarrett\qtpyconvert\venv\lib\site-packages\baron\baron.py", line 70, in tokenize
return mark_indentation(inner_group(space_group(_tokenize(group(split(pouet)), print_function))))
File "Q:\Tools\eng\bjarrett\qtpyconvert\venv\lib\site-packages\baron\indentation_marker.py", line 24, in mark_indentation
return list(mark_indentation_generator(sequence))
File "Q:\Tools\eng\bjarrett\qtpyconvert\venv\lib\site-packages\baron\indentation_marker.py", line 85, in mark_indentation_generator
the_indentation_level_changed = get_space(current) is None or get_space(current) != indentations[-1]
File "Q:\Tools\eng\bjarrett\qtpyconvert\venv\lib\site-packages\baron\indentation_marker.py", line 38, in get_space
if len(node) < 3 or len(node[3]) == 0:
IndexError: tuple index out of range
The source that causes the error:
from PySide import QtGui
if True:
app = QtGui.QApplication([])
Note there is a trailing space after the QApplication constructor. Here's the hex for clarity
The conversion fails with the following error when you have trailing whitespace inside of an indentation block.
The source that causes the error:
Note there is a trailing space after the QApplication constructor. Here's the hex for clarity