]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
Revert "Fixed issue #109: `ImportWarning` warned when `import babel`"
authorLasse Schuirmann <lasse.schuirmann@gmail.com>
Tue, 22 Sep 2015 21:36:20 +0000 (23:36 +0200)
committerLasse Schuirmann <lasse.schuirmann@gmail.com>
Fri, 25 Sep 2015 19:18:39 +0000 (21:18 +0200)
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

babel/localedata.py [moved from babel/localedata/__init__.py with 94% similarity]
babel/localedata/.gitignore

similarity index 94%
rename from babel/localedata/__init__.py
rename to babel/localedata.py
index c48b9f586fc666703553307c782968ee8ee65a6e..1d3af9bf832e2c6ad6db7cd1be4f755e48197f25 100644 (file)
@@ -5,8 +5,8 @@
 
     Low-level locale data access.
 
-    :note: The `Locale` class, which uses this module under the hood, provides
-           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
index 2cbf0fc75d7a021120fd386648df8a42dfecf38e..72e8ffc0db8aad71a934dd11e5968bd5109e54b4 100644 (file)
@@ -1,2 +1 @@
 *
-!__init__.py