Do not add ADD_CHECK_PY_IMPORTS to libraries with PY_MAIN
Libraries are allowed to specify the entry point of the programs that link with
them, but they can not have import tests.
@@ -484,6 +484,8 @@ def onpy_register(unit, *args):
def py_main(unit, arg):
+ is_program = unit.get('MODULE_TYPE') == 'PROGRAM'
+ if is_program:
py_program(unit, is_py3(unit))
unit.onresource(['-', 'PY_MAIN={}'.format(arg)])
