[jhbuild] bump minimal required Python version to 2.3
- From: Frederic Peters <fpeters src gnome org>
- To: svn-commits-list gnome org
- Subject: [jhbuild] bump minimal required Python version to 2.3
- Date: Tue, 7 Jul 2009 08:40:14 +0000 (UTC)
commit 21182bc103a67f8665fd7018955f51f8a914056f
Author: Frédéric Péters <fpeters 0d be>
Date: Mon Jul 6 19:26:59 2009 +0200
bump minimal required Python version to 2.3
README | 2 +-
jhbuild/cut_n_paste/optparse.py | 2008 ---------------------------------------
jhbuild/monkeypatch.py | 48 -
3 files changed, 1 insertions(+), 2057 deletions(-)
---
diff --git a/README b/README
index 0a954ac..000bf53 100644
--- a/README
+++ b/README
@@ -8,7 +8,7 @@ They don't enforce any particular checkout, build or install
directories for your gnome2 setup (this is deduced from the config
file).
-You must have python >= 2.2 installed for jhbuild to run.
+You must have python >= 2.3 installed for jhbuild to run.
Note that the included module sets build most software from CVS (or
equivalent), so you may encounter occasional build failures.
diff --git a/jhbuild/monkeypatch.py b/jhbuild/monkeypatch.py
index ddd1928..7d30373 100644
--- a/jhbuild/monkeypatch.py
+++ b/jhbuild/monkeypatch.py
@@ -17,8 +17,6 @@
# extras not found in old versions of Python
-from __future__ import generators
-
import sys
# Windows lacks all sorts of subprocess features that we need to kludge around
@@ -26,52 +24,6 @@ if sys.platform.startswith('win'):
from jhbuild.utils import subprocess_win32
sys.modules['subprocess'] = subprocess_win32
-# Python < 2.2.1 lacks True and False constants
-import __builtin__
-if not hasattr(__builtin__, 'True'):
- __builtin__.True = (1 == 1)
- __builtin__.False = (1 != 1)
-
-# Python < 2.3 lacks enumerate() builtin
-if not hasattr(__builtin__, 'enumerate'):
- def enumerate(iterable):
- index = 0
- for item in iterable:
- yield (index, item)
- index += 1
- __builtin__.enumerate = enumerate
-
-# Python < 2.3 lacks optparse module
-try:
- import optparse
-except ImportError:
- from jhbuild.cut_n_paste import optparse
- sys.modules['optparse'] = optparse
-
-# Python < 2.3 lacks locale.getpreferredencoding() function
-import locale
-if not hasattr(locale, 'getpreferredencoding'):
- try:
- locale.CODESET
- except NameError:
- # Fall back to parsing environment variables :-(
- def getpreferredencoding(do_setlocale = True):
- """Return the charset that the user is likely using,
- by looking at environment variables."""
- return locale.getdefaultlocale()[1]
- else:
- def getpreferredencoding(do_setlocale = True):
- """Return the charset that the user is likely using,
- according to the system configuration."""
- if do_setlocale:
- oldloc = locale.setlocale(locale.LC_CTYPE)
- locale.setlocale(locale.LC_CTYPE, "")
- result = locale.nl_langinfo(locale.CODESET)
- locale.setlocale(locale.LC_CTYPE, oldloc)
- return result
- else:
- return locale.nl_langinfo(locale.CODESET)
-
# Python < 2.4 lacks reversed() builtin
if not hasattr(__builtin__, 'reversed'):
def reversed(l):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]