From 9677840a0fa938d2e1a91b094a5e20160ca74e8f Mon Sep 17 00:00:00 2001 From: Phoenix <63447220+PhoenixCreation@users.noreply.github.com> Date: Wed, 14 Jul 2021 12:08:20 +0530 Subject: [PATCH] Fix title retrieval in page function Correct the order of title assignment in page function. line 272. title should be assigned with result[0] first instead of suggestion first. ```diff - suggestion or results[0] + results[0] or suggestion ``` --- wikipedia/wikipedia.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wikipedia/wikipedia.py b/wikipedia/wikipedia.py index 040901a..3d3b114 100644 --- a/wikipedia/wikipedia.py +++ b/wikipedia/wikipedia.py @@ -269,7 +269,7 @@ def page(title=None, pageid=None, auto_suggest=True, redirect=True, preload=Fals if auto_suggest: results, suggestion = search(title, results=1, suggestion=True) try: - title = suggestion or results[0] + title = results[0] or suggestion except IndexError: # if there is no suggestion or search results, the page doesn't exist raise PageError(title)