From b81eec951bd9a57ddb135bddbb472e1a5a8271b5 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Fri, 7 Feb 2020 17:38:16 -0600 Subject: [PATCH] sanitycheck: make pyserial optional We only need pyserial python module if we are doing device testing. Treat it similar to how we treat tabulate module. Signed-off-by: Kumar Gala --- scripts/sanitycheck | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/sanitycheck b/scripts/sanitycheck index e81928c6e97..979e22d92cd 100755 --- a/scripts/sanitycheck +++ b/scripts/sanitycheck @@ -185,7 +185,6 @@ import time import csv import yaml import glob -import serial import concurrent import xml.etree.ElementTree as ET import logging @@ -195,6 +194,11 @@ from itertools import islice from pathlib import Path from distutils.spawn import find_executable +try: + import serial +except ImportError: + print("Install pyserial python module with pip to use --device-testing option.") + try: from anytree import Node, RenderTree, find except ImportError: