[OE-core] [PATCH] selftest/buildoptions: pexpect not a builtin module
Benjamin Esquivel
benjamin.esquivel at linux.intel.com
Thu Sep 17 20:38:31 UTC 2015
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 at 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
More information about the Openembedded-core
mailing list