From: Felix Schwarz Date: Tue, 24 Jul 2012 08:20:14 +0000 (+0000) Subject: remove ElementTree import from babel.compat as this introduces a new (unnecessary... X-Git-Tag: 1.0~172 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e9449a570e96fbf61a947559539d9ab0959da86b;p=thirdparty%2Fbabel.git remove ElementTree import from babel.compat as this introduces a new (unnecessary) dependency for Python 2.4 users --- diff --git a/babel/compat.py b/babel/compat.py index c5479d23..8aab36fe 100644 --- a/babel/compat.py +++ b/babel/compat.py @@ -11,11 +11,6 @@ # individuals. For the exact contribution history, see the revision # history and logs, available at http://babel.edgewall.org/log/. -try: - from xml.etree import ElementTree -except ImportError: - from elementtree import ElementTree - try: any = any except NameError: diff --git a/scripts/import_cldr.py b/scripts/import_cldr.py index 65654ceb..ca91be58 100755 --- a/scripts/import_cldr.py +++ b/scripts/import_cldr.py @@ -17,12 +17,18 @@ from optparse import OptionParser import os import re import sys +# don't put the ElementTree import in babel/compat.py as this will add a new +# dependency (elementtree) for Python 2.4 users. +try: + from xml.etree import ElementTree +except ImportError: + from elementtree import ElementTree # Make sure we're using Babel source, and not some previously installed version sys.path.insert(0, os.path.join(os.path.dirname(sys.argv[0]), '..')) from babel import dates, numbers -from babel.compat import any, ElementTree +from babel.compat import any from babel.plural import PluralRule from babel.localedata import Alias