Merge pull request #202 from phl0/fixnextion

Make nextion.py compatible with pyserial < v3
This commit is contained in:
Jonathan Naylor 2016-11-07 10:45:49 +00:00 committed by GitHub
commit 3aac82a23d

View file

@ -111,8 +111,12 @@ if __name__ == "__main__":
except serial.serialutil.SerialException:
print 'could not open serial device ' + sys.argv[2]
exit(1)
if not ser.is_open:
ser.open()
if (serial.VERSION <= "3.0"):
if not ser.isOpen():
ser.open()
else:
if not ser.is_open:
ser.open()
checkModel = None
if len(sys.argv) == 4: