Skip to content

Commit

Permalink
esptool: Add some clarification if list_ports is missing
Browse files Browse the repository at this point in the history
Closes #350

Also fixes regression in detecting wrong 'serial' module (see #269)
  • Loading branch information
projectgus committed Dec 21, 2018
1 parent fbd8c86 commit 7a83a06
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions esptool.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@
import time
import zlib
import string
import serial.tools.list_ports as list_ports

import serial
try:
import serial
except ImportError:
print("Pyserial is not installed for %s. Check the README for installation instructions." % (sys.executable))
raise

# check 'serial' is 'pyserial' and not 'serial' https://github.com/espressif/esptool/issues/269
try:
Expand All @@ -50,6 +53,12 @@
except TypeError:
pass # __doc__ returns None for pyserial

try:
import serial.tools.list_ports as list_ports
except ImportError:
print("The installed version (%s) of pyserial appears to be too old for esptool.py (Python interpreter %s). "
"Check the README for installation instructions." % (sys.VERSION, sys.executable))
raise

__version__ = "2.6-beta1"

Expand Down

0 comments on commit 7a83a06

Please sign in to comment.