http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10909
Revision: 10909 Author: drtrigon Date: 2013-01-13 16:59:07 +0000 (Sun, 13 Jan 2013) Log Message: ----------- bug fix; correct determination of program_dir
Modified Paths: -------------- trunk/pywikipedia/pywikibot/version.py
Modified: trunk/pywikipedia/pywikibot/version.py =================================================================== --- trunk/pywikipedia/pywikibot/version.py 2013-01-13 16:25:58 UTC (rev 10908) +++ trunk/pywikipedia/pywikibot/version.py 2013-01-13 16:59:07 UTC (rev 10909) @@ -117,8 +117,9 @@ # without importing it (thus can be done for any file) # def getfileversion(filename): + _program_dir = os.path.normpath(os.path.dirname(sys.argv[0])) __version__ = None - fn = os.path.abspath(os.path.join(os.curdir, filename)) + fn = os.path.join(_program_dir, filename) if os.path.exists(fn): for line in open(fn, 'r').readlines(): if line.find('__version__') == 0:
pywikipedia-svn@lists.wikimedia.org