Commit 13245d4c authored by Ayush Tiwari's avatar Ayush Tiwari

bt5_config: Handle error more precisely in download function

parent abecde7f
...@@ -401,11 +401,15 @@ class TemplateTool (BaseTool): ...@@ -401,11 +401,15 @@ class TemplateTool (BaseTool):
for path in template_version_path_list: for path in template_version_path_list:
try: try:
file = open(os.path.normpath(format_version_path)) file = open(os.path.normpath(path))
except IOError: except IOError:
pass continue
format_version = int(file.read()) try:
file.close() format_version = int(file.read())
file.close()
except UnboundLocalError:
# In case none of the above paths do have template_format_version
format_version = 1
# XXX: Download only needed in case the file is in directory # XXX: Download only needed in case the file is in directory
bt = self._download_local(os.path.normpath(name), id, format_version) bt = self._download_local(os.path.normpath(name), id, format_version)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment