[PATCH] rtemstoolkit: Fix imports and fix all unittests.

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Oct 5 06:07:24 UTC 2018


On 05/10/2018 07:49, Chris Johns wrote:
> On 05/10/2018 15:19, Sebastian Huber wrote:
>> Hello Chris,
>>
>> On 05/10/2018 06:24,chrisj at rtems.org  wrote:
>>> -#
>>> -# Support to handle use in a package and as a unit test.
>>> -# If there is a better way to let us know.
>>> -#
>>> -try:
>>> -    from . import error
>>> -    from . import execute
>>> -    from . import log
>>> -    from . import options
>>> -    from . import path
>>> -    from . import version
>>> -except (ValueError, SystemError):
>>> -    import error
>>> -    import execute
>>> -    import log
>>> -    import options
>>> -    import path
>>> -    import version
>>> +from rtemstoolkit import error
>>> +from rtemstoolkit import execute
>>> +from rtemstoolkit import log
>>> +from rtemstoolkit import options
>>> +from rtemstoolkit import path
>>> +from rtemstoolkit import version
>> does this work on msys2?
>>
> With python3? I have not tested python3.

The import seems to work, so this patch is fine.

$ ./waf configure
Setting top to                           : /c/msys2/home/rtems-tools
Setting out to                           : /c/msys2/home/rtems-tools/build
Version                                  : 5.af365cedb85c- (5)
Checking for program 'python'            : /usr/bin/python
Checking for python version >= 2.6.6     : 3.6.2
Checking for 'clang' (C compiler)        : not found
Checking for 'gcc' (C compiler)          : /usr/bin/gcc
Checking for 'clang++' (C++ compiler)    : not found
Checking for 'g++' (C++ compiler)        : /usr/bin/g++

Problems appear later (this is expected):

$ ./rtems-test --version
Traceback (most recent call last):
   File "./rtems-test", line 39, in <module>
     import rt.test
...
   File "/c/msys2/home/test/share/rtems/tester/rt/tftpy/TftpStates.py", 
line 371
     raise TftpException, "Dynamic path %s not permitted" % path
                        ^
SyntaxError: invalid syntax

-- 
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