[PATCH 1/2] rtemstoolkit: Python 3 compatibility

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Jan 8 09:10:23 UTC 2016



On 08/01/16 10:03, Chris Johns wrote:
> On 8/01/2016 7:50 PM, Sebastian Huber wrote:
>> On 08/01/16 08:00, Sebastian Huber wrote:
>>> ---
>>>    rtemstoolkit/execute.py | 2 +-
>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/rtemstoolkit/execute.py b/rtemstoolkit/execute.py
>>> index 4125182..0344e51 100755
>>> --- a/rtemstoolkit/execute.py
>>> +++ b/rtemstoolkit/execute.py
>>> @@ -177,7 +177,7 @@ class execute(object):
>>>                            break
>>>                        #print '))))) %02x "%s"' % (ord(data), data)
>>>                        for c in data:
>>> -                        line += c
>>> +                        line += str(c)
>>>                            if c == '\n':
>>>                                count += 1
>>>                                _output_line(line, exe, prefix, out, count)
>> I am not sure if this fix is correct. Python 3 refuses to accept the
>> previous code since implicit int to str conversions are forbidden.
>>
> The code looks fine to me.
>
> What is the error?

TypeError: Can't convert 'int' object to str implicitly

>
> Can you print the type of 'c'?

<class 'int'>

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.




More information about the devel mailing list