diff options
| author | Daniel Latypov <[email protected]> | 2021-10-22 00:49:36 +0000 |
|---|---|---|
| committer | Shuah Khan <[email protected]> | 2021-10-29 19:05:47 +0000 |
| commit | 52a5d80a2225e2d0b2a8f4656b76aead2a443b2a (patch) | |
| tree | e383850521fa0b429aa840dd30442b03df86e3f9 /lib/string_helpers.c | |
| parent | kunit: tool: continue past invalid utf-8 output (diff) | |
| download | kernel-52a5d80a2225e2d0b2a8f4656b76aead2a443b2a.tar.gz kernel-52a5d80a2225e2d0b2a8f4656b76aead2a443b2a.zip | |
kunit: tool: fix typecheck errors about loading qemu configs
Currently, we have these errors:
$ mypy ./tools/testing/kunit/*.py
tools/testing/kunit/kunit_kernel.py:213: error: Item "_Loader" of "Optional[_Loader]" has no attribute "exec_module"
tools/testing/kunit/kunit_kernel.py:213: error: Item "None" of "Optional[_Loader]" has no attribute "exec_module"
tools/testing/kunit/kunit_kernel.py:214: error: Module has no attribute "QEMU_ARCH"
tools/testing/kunit/kunit_kernel.py:215: error: Module has no attribute "QEMU_ARCH"
exec_module
===========
pytype currently reports no errors, but that's because there's a comment
disabling it on 213.
This is due to https://github.com/python/typeshed/pull/2626.
The fix is to assert the loaded module implements the ABC
(abstract base class) we want which has exec_module support.
QEMU_ARCH
=========
pytype is fine with this, but mypy is not:
https://github.com/python/mypy/issues/5059
Add a check that the loaded module does indeed have QEMU_ARCH.
Note: this is not enough to appease mypy, so we also add a comment to
squash the warning.
Signed-off-by: Daniel Latypov <[email protected]>
Reviewed-by: David Gow <[email protected]>
Reviewed-by: Brendan Higgins <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
Diffstat (limited to 'lib/string_helpers.c')
0 files changed, 0 insertions, 0 deletions
