]> granicus.if.org Git - python/commitdiff
Issue #11621: fix bootstrap issue with getopt/gettext (following d3e46930ffe9)
authorAntoine Pitrou <solipsis@pitrou.net>
Mon, 21 Mar 2011 15:04:06 +0000 (16:04 +0100)
committerAntoine Pitrou <solipsis@pitrou.net>
Mon, 21 Mar 2011 15:04:06 +0000 (16:04 +0100)
Lib/getopt.py

index e4cab75c7e3912784f26b11376bba053597e2652..3d6ecbddb99cd752ed027c589ee79db0527201bf 100644 (file)
@@ -34,7 +34,11 @@ option involved with the exception.
 __all__ = ["GetoptError","error","getopt","gnu_getopt"]
 
 import os
-from gettext import gettext as _
+try:
+    from gettext import gettext as _
+except ImportError:
+    # Bootstrapping Python: gettext's dependencies not built yet
+    def _(s): return s
 
 class GetoptError(Exception):
     opt = ''