Fix index out of range error when using dfu switch and dfu flashing

This commit is contained in:
PAJohnson
2021-05-21 00:12:41 -04:00
parent 7c4273d0ba
commit 150c3b0373
2 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -53,4 +53,4 @@ def find_any(path=default_search_path, serial_number=None,
channel_termination_token.set()
raise
return result[0]
return result[0] if len(result) > 0 else None
+5 -4
View File
@@ -32,14 +32,14 @@ to publish packages with the name odrive.
"""
# Set to true to make the current release
is_release = True
is_release = False
# Set to true to make an official post-release, rather than dev of new version
is_post_release = False
post_rel_num = 0
# To test higher numbered releases, bump to the next rev
devnum = 0
devnum = 6
bump_rev = not is_post_release and not is_release
# TODO: add additional y/n prompt to prevent from erroneous upload
@@ -67,8 +67,9 @@ version = odrive.version.get_version_str(
if creating_package:
if is_post_release:
version += str(post_rel_num)
elif (devnum > 0):
version += str(devnum)
#elif (devnum > 0):
# version += str(devnum)
version+= str(devnum)
version_file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'odrive', 'version.txt')
with open(version_file_path, mode='w') as version_file: