[pypy-svn] r61238 - pypy/trunk/lib-python/modified-2.5.2

arigo at codespeak.net arigo at codespeak.net
Thu Jan 22 15:54:49 CET 2009


Author: arigo
Date: Thu Jan 22 15:54:49 2009
New Revision: 61238

Modified:
   pypy/trunk/lib-python/modified-2.5.2/gettext.py
Log:
Raising an exception is too strong.  Instead, just returns None or an
empty list as appropriate.



Modified: pypy/trunk/lib-python/modified-2.5.2/gettext.py
==============================================================================
--- pypy/trunk/lib-python/modified-2.5.2/gettext.py	(original)
+++ pypy/trunk/lib-python/modified-2.5.2/gettext.py	Thu Jan 22 15:54:49 2009
@@ -426,8 +426,6 @@
     # Get some reasonable defaults for arguments that were not supplied
     if localedir is None:
         localedir = _default_localedir
-        if localedir is None:
-            raise TypeError("'localedir' argument required on PyPy")
     if languages is None:
         languages = []
         for envar in ('LANGUAGE', 'LC_ALL', 'LC_MESSAGES', 'LANG'):
@@ -448,6 +446,8 @@
         result = []
     else:
         result = None
+    if localedir is None:   # PyPy only: no default
+        return result
     for lang in nelangs:
         if lang == 'C':
             break



More information about the Pypy-commit mailing list