px_uploader.py: fix version check

Presumably older versions of pyserial do not implement __version__ but
only VERSION, so we need to check for that as well.
This commit is contained in:
Julian Oes
2019-04-23 09:33:00 +02:00
parent 42d0522cdd
commit a9c3bce20d

View File

@@ -728,7 +728,7 @@ def main():
# We need to check for pyserial because the import itself doesn't # We need to check for pyserial because the import itself doesn't
# seem to fail, at least not on macOS. # seem to fail, at least not on macOS.
try: try:
if serial.__version__: if serial.__version__ or serial.VERSION:
pass pass
except: except:
print("Error: pyserial not installed!") print("Error: pyserial not installed!")