Fix pylint complaints.

This commit is contained in:
Imran Sobir 2017-02-07 19:25:01 +05:00
parent 216cef8d9f
commit 9a218256b7

View File

@ -169,9 +169,10 @@ def qute_history(url):
try: try:
query_date = QUrlQuery(url).queryItemValue("date") query_date = QUrlQuery(url).queryItemValue("date")
if query_date: if query_date:
curr_date = datetime.datetime.strptime(query_date, "%Y-%m-%d").date() curr_date = datetime.datetime.strptime(query_date, "%Y-%m-%d")
curr_date = curr_date.date()
except ValueError: except ValueError:
log.misc.error("Invalid date passed to qute:history: {}.".format(query_date)) log.misc.error("Invalid date passed to qute:history: " + query_date)
one_day = datetime.timedelta(days=1) one_day = datetime.timedelta(days=1)
next_date = curr_date + one_day next_date = curr_date + one_day
@ -201,10 +202,7 @@ def qute_history(url):
yield (item_url, item_title, display_atime) yield (item_url, item_title, display_atime)
try: history = reversed(list(history_iter()))
history = reversed(history_iter())
except TypeError: # Python < 3.5
history = reversed(list(history_iter()))
html = jinja.render('history.html', html = jinja.render('history.html',
title='History', title='History',