mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	gh-126357: Remove gettext import guards (GH-126358)
This commit is contained in:
		
							parent
							
								
									19d9358437
								
							
						
					
					
						commit
						ac556a2ad1
					
				
					 2 changed files with 4 additions and 18 deletions
				
			
		| 
						 | 
				
			
			@ -75,6 +75,8 @@
 | 
			
		|||
 | 
			
		||||
import sys, os
 | 
			
		||||
import textwrap
 | 
			
		||||
from gettext import gettext as _, ngettext
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def _repr(self):
 | 
			
		||||
    return "<%s at 0x%x: %s>" % (self.__class__.__name__, id(self), self)
 | 
			
		||||
| 
						 | 
				
			
			@ -86,19 +88,6 @@ def _repr(self):
 | 
			
		|||
#   Id: help.py 527 2006-07-23 15:21:30Z greg
 | 
			
		||||
#   Id: errors.py 509 2006-04-20 00:58:24Z gward
 | 
			
		||||
 | 
			
		||||
try:
 | 
			
		||||
    from gettext import gettext, ngettext
 | 
			
		||||
except ImportError:
 | 
			
		||||
    def gettext(message):
 | 
			
		||||
        return message
 | 
			
		||||
 | 
			
		||||
    def ngettext(singular, plural, n):
 | 
			
		||||
        if n == 1:
 | 
			
		||||
            return singular
 | 
			
		||||
        return plural
 | 
			
		||||
 | 
			
		||||
_ = gettext
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class OptParseError (Exception):
 | 
			
		||||
    def __init__(self, msg):
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue