test suite reviews and discussions
 help / color / mirror / Atom feed
From: Zhimin Huang <zhiminx.huang@intel.com>
To: dts@dpdk.org
Cc: Zhimin Huang <zhiminx.huang@intel.com>
Subject: [dts][PATCH V1] framework/tester:optimize handing of import error
Date: Sat, 17 Sep 2022 21:04:18 +0800	[thread overview]
Message-ID: <20220917130418.1690-1-zhiminx.huang@intel.com> (raw)

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


             reply	other threads:[~2022-09-17  4:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-17 13:04 Zhimin Huang [this message]
2022-10-10  3:12 ` lijuan.tu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220917130418.1690-1-zhiminx.huang@intel.com \
    --to=zhiminx.huang@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).