mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
Fix px_uploader.py to work in 16.04 with Python 2.7.
Before, the pyserial check would fail before it could check for the VERSION that the Python 2.7 version contains. This fixes it to check for the VERSION independently.
This commit is contained in:
@@ -727,10 +727,20 @@ 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.
|
||||||
|
pyserial_installed = False
|
||||||
try:
|
try:
|
||||||
if serial.__version__ or serial.VERSION:
|
if serial.__version__:
|
||||||
pass
|
pyserial_installed = True
|
||||||
except:
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
if serial.VERSION:
|
||||||
|
pyserial_installed = True
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
if not pyserial_installed:
|
||||||
print("Error: pyserial not installed!")
|
print("Error: pyserial not installed!")
|
||||||
print(" (Install using: sudo pip install pyserial)")
|
print(" (Install using: sudo pip install pyserial)")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user