Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] selftest/buildoptions: pexpect not a builtin module
@ 2015-09-17 20:38 Benjamin Esquivel
  2015-09-18 11:05 ` Burton, Ross
  0 siblings, 1 reply; 9+ messages in thread
From: Benjamin Esquivel @ 2015-09-17 20:38 UTC (permalink / raw)
  To: openembedded-core; +Cc: paul.eggleton

put the import of pexpect around a try statement so it can tell you
why it failed to import when in a system that has the module unreachable

the message that outputs is:

"No module named pexpect, import failed"

Signed-off-by: Benjamin Esquivel <benjamin.esquivel@linux.intel.com>
---
 meta/lib/oeqa/selftest/buildoptions.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oeqa/selftest/buildoptions.py b/meta/lib/oeqa/selftest/buildoptions.py
index 483803b..9a3c9a1 100644
--- a/meta/lib/oeqa/selftest/buildoptions.py
+++ b/meta/lib/oeqa/selftest/buildoptions.py
@@ -3,7 +3,13 @@ import os
 import logging
 import re
 import glob as g
-import pexpect as p
+
+try:
+    import pexpect as p
+except  ImportError as e:
+    import sys
+    sys.stderr.write("{}, import failed\n".format(e))
+    raise e
 
 from oeqa.selftest.base import oeSelfTest
 from oeqa.selftest.buildhistory import BuildhistoryBase
-- 
2.5.1



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

end of thread, other threads:[~2015-09-21 16:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-17 20:38 [PATCH] selftest/buildoptions: pexpect not a builtin module Benjamin Esquivel
2015-09-18 11:05 ` Burton, Ross
2015-09-18 11:37   ` Paul Eggleton
2015-09-18  8:34     ` [PATCH V2] " Benjamin Esquivel
2015-09-21  8:37       ` Istrate, Daniel AlexandruX
2015-09-21 10:19         ` Burton, Ross
2015-09-21 10:49           ` Istrate, Daniel AlexandruX
2015-09-21 16:27             ` Benjamin Esquivel
2015-09-18 16:31   ` [PATCH] " Benjamin Esquivel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox