jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] Siteinfo: Check if expired correctly ......................................................................
[FIX] Siteinfo: Check if expired correctly
Change-Id: I6591eec36aa474d0ac89ba77d117a3176825017d --- M pywikibot/site.py 1 file changed, 2 insertions(+), 1 deletion(-)
Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py index eb7cf93..2a7a601 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -1029,12 +1029,13 @@
@staticmethod def _is_expired(cache_date, expire): + """Return true if the cache date is expired.""" if expire is False: # can never expire return False elif not cache_date: # default values are always expired return True else: - return datetime.datetime.utcnow() - expire < cache_date + return cache_date + expire >= datetime.datetime.utcnow()
def _get_general(self, key, expiry): """