Revision: 4484
Author: valhallasw
Date: 2007-10-30 16:42:25 +0000 (Tue, 30 Oct 2007)
Log Message:
-----------
try: except: finally: -> try: (try: except:) finally: ,for python 2.4 compatibility. By
Filnik
Modified Paths:
--------------
trunk/pywikipedia/welcome.py
Modified: trunk/pywikipedia/welcome.py
===================================================================
--- trunk/pywikipedia/welcome.py 2007-10-29 06:41:05 UTC (rev 4483)
+++ trunk/pywikipedia/welcome.py 2007-10-30 16:42:25 UTC (rev 4484)
@@ -861,24 +861,25 @@
if __name__ == "__main__":
# Use try and finally, to put the wikipedia.stopme() always at the end of the code.
try:
- number_user = None
- settingsBot = mainSettings()
- # Take two settings for the "finally" block.
- filename = settingsBot[2]
- random = settingsBot[11]
- savedata = settingsBot[13]
- # I need to know what is the number_user, in this way I get it.
- for x in main(settingsBot):
- try:
- number_user = x[0]
- except TypeError:
- number_user = x
- else:
- break
- except wikipedia.BadTitle:
- wikipedia.output(u"Wikidown or server's problem. Quit.")
- wikipedia.stopme()
- # finally:
+ try:
+ number_user = None
+ settingsBot = mainSettings()
+ # Take two settings for the "finally" block.
+ filename = settingsBot[2]
+ random = settingsBot[11]
+ savedata = settingsBot[13]
+ # I need to know what is the number_user, in this way I get it.
+ for x in main(settingsBot):
+ try:
+ number_user = x[0]
+ except TypeError:
+ number_user = x
+ else:
+ break
+ except wikipedia.BadTitle:
+ wikipedia.output(u"Wikidown or server's problem. Quit.")
+ wikipedia.stopme()
+ finally:
# If there is the savedata, the script must save the number_user.
if random == True and savedata == True and number_user != None:
f = file(filename, 'w')