Skip to content

Commit b81eec9

Browse files
committed
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 <[email protected]>
1 parent d62dfe8 commit b81eec9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/sanitycheck

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ import time
185185
import csv
186186
import yaml
187187
import glob
188-
import serial
189188
import concurrent
190189
import xml.etree.ElementTree as ET
191190
import logging
@@ -195,6 +194,11 @@ from itertools import islice
195194
from pathlib import Path
196195
from distutils.spawn import find_executable
197196

197+
try:
198+
import serial
199+
except ImportError:
200+
print("Install pyserial python module with pip to use --device-testing option.")
201+
198202
try:
199203
from anytree import Node, RenderTree, find
200204
except ImportError:

0 commit comments

Comments
 (0)