Revision: 8453 Author: valhallasw Date: 2010-08-24 21:35:36 +0000 (Tue, 24 Aug 2010)
Log Message: ----------- Removed try-catch block resulting in confusing errors.
The check for an existing user-config.py is already located in wikipediatools.py. The check I removed resulted in confusing errors because some family files triggered the KeyError. These will now give a stack trace showing the origin of the problem.
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2010-08-24 13:21:47 UTC (rev 8452) +++ trunk/pywikipedia/wikipedia.py 2010-08-24 21:35:36 UTC (rev 8453) @@ -7339,22 +7339,12 @@ default_code = config.mylang logfile = None # Check -try: - # if the default family+wiki is a non-public one, - # getSite will try login in. We don't want that, the module - # is not yet loaded. - getSite(noLogin=True) -except KeyError: - print( -u"""Please create a file user-config.py, and put in there:\n -One line saying "mylang='language'" -One line saying "usernames['wikipedia']['language']='yy'"\n -...filling in your username and the language code of the wiki you want to work -on.\n -For other possible configuration variables check config.py. -""") - sys.exit(1)
+# if the default family+wiki is a non-public one, +# getSite will try login in. We don't want that, the module +# is not yet loaded. +getSite(noLogin=True) + # Set socket timeout socket.setdefaulttimeout(config.socket_timeout)
pywikipedia-svn@lists.wikimedia.org