Some robustness against malformed timestamps
This commit is contained in:
parent
a2f64398e7
commit
dd0d23e72e
1 changed files with 7 additions and 4 deletions
|
@ -70,10 +70,13 @@ if __name__ == "__main__":
|
|||
if os.path.exists(os.path.join(addon_obj.get_dir(), ADDONVER_FILE)):
|
||||
with open(os.path.join(addon_obj.get_dir(), ADDONVER_FILE), "r") as stamp_file:
|
||||
str_timestamp = stamp_file.read()
|
||||
local_timestamp = int(str_timestamp)
|
||||
if local_timestamp == server_timestamp:
|
||||
logging.info("Addon '%s' is up-to-date.", addon_name)
|
||||
return False
|
||||
try:
|
||||
local_timestamp = int(str_timestamp)
|
||||
if local_timestamp == server_timestamp:
|
||||
logging.info("Addon '%s' is up-to-date.", addon_name)
|
||||
return False
|
||||
except:
|
||||
pass
|
||||
|
||||
# Download the addon.
|
||||
extract(addon_server, addon_name, temp_dir)
|
||||
|
|
Loading…
Add table
Reference in a new issue