Comment 15 for bug 1354731

Revision history for this message
In , Billie-gentoo (billie-gentoo) wrote :

(In reply to Fab from comment #8)
>
> When doing this modification in hplip-3.14.10, an exception is catched, the
> output of hp-levels -g is changing from :
>
> > hp-levels[7759]: debug: num_pens = 2
> > hp-levels[7759]: debug: pen 0 {'index': 0, 'kind': 3L, 'level': 194, 'ack': True,
> > 'hp-ink': False, 'dvc': 36480L, 'level-trigger': 0, 'virgin': True, 'health': 0,
> > 'known': False, 'type': 0, 'id': 0}
> > hp-levels[7759]: debug: pen 1 {'index': 1, 'kind': 0L, 'level': 66, 'ack': True,
> > 'hp-ink': False, 'dvc': 5580L, 'level-trigger': 0, 'virgin': True, 'health': 0,
> > 'known': False, 'type': 0, 'id': 17}
> > error: Error attempting to read r-value (2).
>
> To :
>
> > hp-levels[7730]: debug: num_pens = 2
> > warning: Status parsing error: 'int' object is not iterable
> > error: Error attempting to read r-value (2).
>

Sorry, my fault. The change should look like this (using list instead of length, this should result in he same behavior for python2 and python3 ):

for p in list(range(num_pens)):