From c0e309bbd961363294974ebc860ad0f4b731e3c7 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Thu, 23 Aug 2012 17:29:02 -0400 Subject: [PATCH] Simplify a bit of code in Page --- earwigbot/wiki/page.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/earwigbot/wiki/page.py b/earwigbot/wiki/page.py index 455ef83..7e30cb3 100644 --- a/earwigbot/wiki/page.py +++ b/earwigbot/wiki/page.py @@ -214,15 +214,8 @@ class Page(CopyvioMixIn): res = result["query"]["pages"].values()[0] - # Normalize our pagename/title thing: - self._title = res["title"] - - try: - res["redirect"] - except KeyError: - self._is_redirect = False - else: - self._is_redirect = True + self._title = res["title"] # Normalize our pagename/title + self._is_redirect = "redirect" in res self._pageid = int(result["query"]["pages"].keys()[0]) if self._pageid < 0: