]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
Only attempt a normalization search if filesystem lookup fails. 361/head
authorKevin Deldycke <kdeldycke@scaleway.com>
Thu, 3 Mar 2016 17:17:44 +0000 (18:17 +0100)
committerKevin Deldycke <kdeldycke@scaleway.com>
Thu, 3 Mar 2016 17:17:44 +0000 (18:17 +0100)
babel/localedata.py

index 265e4b8fd4fa929c554d2f53f69048e795392c10..1f437379884f97360c79b9172da04a580ae15fef 100644 (file)
@@ -44,7 +44,10 @@ def exists(name):
 
     :param name: the locale identifier string
     """
-    return True if normalize_locale(name) else False
+    if name in _cache:
+        return True
+    file_found = os.path.exists(os.path.join(_dirname, '%s.dat' % name))
+    return True if file_found else bool(normalize_locale(name))
 
 
 def locale_identifiers():