http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10464
Revision: 10464 Author: xqt Date: 2012-08-02 04:15:07 +0000 (Thu, 02 Aug 2012) Log Message: ----------- remove old python 2.3 stuff
Modified Paths: -------------- trunk/pywikipedia/interwiki.py trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/interwiki.py =================================================================== --- trunk/pywikipedia/interwiki.py 2012-07-29 11:31:05 UTC (rev 10463) +++ trunk/pywikipedia/interwiki.py 2012-08-02 04:15:07 UTC (rev 10464) @@ -345,33 +345,6 @@ import time import codecs import socket - -try: - set # introduced in Python 2.4: faster and future -except NameError: - from sets import Set as set - -try: sorted ## Introduced in 2.4 -except NameError: - def sorted(seq, cmp=None, key=None, reverse=False): - """Copy seq and sort and return it. - >>> sorted([3, 1, 2]) - [1, 2, 3] - """ - seq2 = copy.copy(seq) - if key: - if cmp is None: - cmp = __builtins__.cmp - seq2.sort(lambda x,y: cmp(key(x), key(y))) - else: - if cmp is None: - seq2.sort() - else: - seq2.sort(cmp) - if reverse: - seq2.reverse() - return seq2 - import wikipedia as pywikibot import config import catlib
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2012-07-29 11:31:05 UTC (rev 10463) +++ trunk/pywikipedia/wikipedia.py 2012-08-02 04:15:07 UTC (rev 10464) @@ -140,19 +140,8 @@ import weakref # Splitting the bot into library parts from pywikibot import * - -# Set the locale to system default. This will ensure correct string -# handling for non-latin characters on Python 2.3.x. For Python 2.4.x it's no -# longer needed. -locale.setlocale(locale.LC_ALL, '') - import config, login, query, version
-try: - set # introduced in Python2.4: faster and future -except NameError: - from sets import Set as set - # Check Unicode support (is this a wide or narrow python build?) # See http://www.python.org/doc/peps/pep-0261/ try: