Revision: 8798 Author: xqt Date: 2010-12-26 12:19:07 +0000 (Sun, 26 Dec 2010) Log Message: ----------- use get statement instead of try/error to assign None
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2010-12-26 10:51:35 UTC (rev 8797) +++ trunk/pywikipedia/wikipedia.py 2010-12-26 12:19:07 UTC (rev 8798) @@ -5757,13 +5757,10 @@ for k, v in data.iteritems(): self._info[k] = v #data pre-process - try: - if dump: - return self._info - else: - return self._info[key] - except KeyError: - return None + if dump: + return self._info + else: + return self._info.get(key)
def mediawiki_message(self, key, forceReload = False): """Return the MediaWiki message text for key "key" """
pywikipedia-svn@lists.wikimedia.org