diff --git a/src/Mod/AddonManager/AddonManager.py b/src/Mod/AddonManager/AddonManager.py index cfae6a6d6127..d0bf50efc59b 100644 --- a/src/Mod/AddonManager/AddonManager.py +++ b/src/Mod/AddonManager/AddonManager.py @@ -258,7 +258,13 @@ def launch(self) -> None: if last_cache_update_string == "never": self.update_cache = True elif days_between_updates > 0: - last_cache_update = date.fromisoformat(last_cache_update_string) + if hasattr(date, "fromisoformat"): + last_cache_update = date.fromisoformat(last_cache_update_string) + else: + # Python 3.6 and earlier don't have date.fromisoformat + date_re = re.compile("([0-9]{4})-?(1[0-2]|0[1-9])-?(3[01]|0[1-9]|[12][0-9])") + matches = date_re.match (last_cache_update_string) + last_cache_update = date(int(matches.group(1)),int(matches.group(2)),int(matches.group(3))) delta_update = timedelta(days=days_between_updates) if date.today() >= last_cache_update + delta_update: self.update_cache = True