Revision: 4014 Author: wikipedian Date: 2007-08-09 14:02:27 +0000 (Thu, 09 Aug 2007)
Log Message: ----------- bugfix
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2007-08-09 12:56:55 UTC (rev 4013) +++ trunk/pywikipedia/wikipedia.py 2007-08-09 14:02:27 UTC (rev 4014) @@ -4141,8 +4141,11 @@ """ # get commandline arguments args = sys.argv - # TODO: check if the following line is platform-independent - return args[0][:args[0].rindex('.')] + try: + # clip off the '.py' filename extension + return args[0][:args[0].rindex('.')] + except ValueError: + return args[0]
def handleArgs(): '''