From: Matthias Klose Date: Thu, 16 Dec 2021 23:13:29 +0000 (+0000) Subject: lib-argparse X-Git-Tag: archive/raspbian/3.9.9-3+rpi1~1^2~24 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=326752a0e304d4b3b884e0ccf39f6c91d553e8cf;p=python3.9.git lib-argparse # DP: argparse.py: Make the gettext import conditional # DP: argparse.py: Make the gettext import conditional Gbp-Pq: Name lib-argparse.diff --- diff --git a/Lib/argparse.py b/Lib/argparse.py index 7c28547..cc4553d 100644 --- a/Lib/argparse.py +++ b/Lib/argparse.py @@ -89,7 +89,16 @@ import os as _os import re as _re import sys as _sys -from gettext import gettext as _, ngettext +try: + from gettext import gettext as _, ngettext +except ImportError: + def _(message): + return message + def ngettext(singular,plural,n): + if n == 1: + return singular + else: + return plural SUPPRESS = '==SUPPRESS=='