From: Kevin O'Connor Date: Mon, 18 Oct 2010 01:38:38 +0000 (-0400) Subject: Report meaningful error if pyserial not present in tools/readserial.py X-Git-Tag: rel-0.6.2~63 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=9433098a3ff236717104f904e0098b91bb7f1329;p=seabios.git Report meaningful error if pyserial not present in tools/readserial.py --- diff --git a/tools/readserial.py b/tools/readserial.py index 505c014..9c955c6 100755 --- a/tools/readserial.py +++ b/tools/readserial.py @@ -111,7 +111,15 @@ def main(): if options.serial: # Read from serial port - import serial + try: + import serial + except ImportError: + print """ +Unable to find pyserial package ( http://pyserial.sourceforge.net/ ). +On Linux machines try: yum install pyserial +Or: apt-get install python-serial +""" + sys.exit(1) ser = serial.Serial(serialport, baud, timeout=0) else: # Read from a file