Merge pull request #202 from phl0/fixnextion
Make nextion.py compatible with pyserial < v3
This commit is contained in:
commit
3aac82a23d
1 changed files with 6 additions and 2 deletions
|
@ -111,6 +111,10 @@ if __name__ == "__main__":
|
|||
except serial.serialutil.SerialException:
|
||||
print 'could not open serial device ' + sys.argv[2]
|
||||
exit(1)
|
||||
if (serial.VERSION <= "3.0"):
|
||||
if not ser.isOpen():
|
||||
ser.open()
|
||||
else:
|
||||
if not ser.is_open:
|
||||
ser.open()
|
||||
|
||||
|
|
Loading…
Reference in a new issue