From: Lasse Schuirmann Date: Tue, 22 Sep 2015 21:36:20 +0000 (+0200) Subject: Revert "Fixed issue #109: `ImportWarning` warned when `import babel`" X-Git-Tag: dev-2a51c9b95d06~12^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d4a1a20de73069ba305820a4cbf934d684d505ca;p=thirdparty%2Fbabel.git Revert "Fixed issue #109: `ImportWarning` warned when `import babel`" This reverts commit 7d387f95f4f41ed646bcb2b4fa39dae4a601b6ce. Another fix will be applied to get rid of #109 because of https://github.com/python-babel/babel/issues/240 . Fixes https://github.com/python-babel/babel/issues/240 --- diff --git a/babel/localedata/__init__.py b/babel/localedata.py similarity index 94% rename from babel/localedata/__init__.py rename to babel/localedata.py index c48b9f58..1d3af9bf 100644 --- a/babel/localedata/__init__.py +++ b/babel/localedata.py @@ -5,8 +5,8 @@ Low-level locale data access. - :note: The `Locale` class, which uses this module under the hood, provides - a more convenient interface for accessing the locale data. + :note: The `Locale` class, which uses this module under the hood, provides a + more convenient interface for accessing the locale data. :copyright: (c) 2013 by the Babel Team. :license: BSD, see LICENSE for more details. @@ -21,7 +21,7 @@ from babel._compat import pickle _cache = {} _cache_lock = threading.RLock() -_dirname = os.path.dirname(__file__) +_dirname = os.path.join(os.path.dirname(__file__), 'localedata') def exists(name): @@ -190,13 +190,13 @@ class LocaleDataDict(MutableMapping): def __getitem__(self, key): orig = val = self._data[key] - if isinstance(val, Alias): # resolve an alias + if isinstance(val, Alias): # resolve an alias val = val.resolve(self.base) - if isinstance(val, tuple): # Merge a partial dict with an alias + if isinstance(val, tuple): # Merge a partial dict with an alias alias, others = val val = alias.resolve(self.base).copy() merge(val, others) - if type(val) is dict: # Return a nested alias-resolving dict + if type(val) is dict: # Return a nested alias-resolving dict val = LocaleDataDict(val, base=self.base) if val is not orig: self._data[key] = val diff --git a/babel/localedata/.gitignore b/babel/localedata/.gitignore index 2cbf0fc7..72e8ffc0 100644 --- a/babel/localedata/.gitignore +++ b/babel/localedata/.gitignore @@ -1,2 +1 @@ * -!__init__.py