test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts][PATCH V1] framework/tester:optimize handing of import error
@ 2022-09-17 13:04 Zhimin Huang
  2022-10-10  3:12 ` lijuan.tu
  0 siblings, 1 reply; 2+ messages in thread
From: Zhimin Huang @ 2022-09-17 13:04 UTC (permalink / raw)
  To: dts; +Cc: Zhimin Huang

the scapy import module failed, it may not be ImportError.
except to import class failed, the module may also fail to import.
if the from module name does not exist, it's will report ModuleNotFoundError.
so add ModuleNotFoundError error in judgement.

Signed-off-by: Zhimin Huang <zhiminx.huang@intel.com>
---
 framework/tester.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/framework/tester.py b/framework/tester.py
index 7414efea..9a228f14 100644
--- a/framework/tester.py
+++ b/framework/tester.py
@@ -87,7 +87,7 @@ class Tester(Crb):
 
         # import scapy moudle to scapy APP
         out = session.session.send_expect(get_scapy_module_impcmd(), ">>> ")
-        if "ImportError" in out:
+        if "ImportError" in out or "ModuleNotFoundError" in out:
             session.logger.warning(f"entering import error: {out}")
 
         return session
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [dts][PATCH V1] framework/tester:optimize handing of import error
  2022-09-17 13:04 [dts][PATCH V1] framework/tester:optimize handing of import error Zhimin Huang
@ 2022-10-10  3:12 ` lijuan.tu
  0 siblings, 0 replies; 2+ messages in thread
From: lijuan.tu @ 2022-10-10  3:12 UTC (permalink / raw)
  To: dts, Zhimin Huang; +Cc: Zhimin Huang

On Sat, 17 Sep 2022 21:04:18 +0800, Zhimin Huang <zhiminx.huang@intel.com> wrote:
> the scapy import module failed, it may not be ImportError.
> except to import class failed, the module may also fail to import.
> if the from module name does not exist, it's will report ModuleNotFoundError.
> so add ModuleNotFoundError error in judgement.
> 
> Signed-off-by: Zhimin Huang <zhiminx.huang@intel.com>


Applied, thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-10-10  3:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-17 13:04 [dts][PATCH V1] framework/tester:optimize handing of import error Zhimin Huang
2022-10-10  3:12 ` lijuan.tu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).