diff options
author | Alasdair <alnessy@hotmail.com> | 2013-09-05 12:03:51 +0200 |
---|---|---|
committer | Alasdair <alnessy@hotmail.com> | 2013-09-05 12:03:51 +0200 |
commit | ba8ee3a6be4049c2bccc03976b7396d7e11b89ca (patch) | |
tree | 381d7ffb1d07174e121f1923bea03e195dd10af7 | |
parent | 521a71199b7c2a517e4f495d38e3b2b55bf4ad41 (diff) |
catch disambiguation errors and display the options
-rwxr-xr-x | wikiquery | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -47,7 +47,10 @@ def main(): page = wikipedia.page(topic) display(page.url) else: - display(wikipedia.summary(topic)) + try: + display(wikipedia.summary(topic)) + except wikipedia.exceptions.DisambiguationError as e: + display(e.options) if __name__ == "__main__": main() |