Package: python3.11 / 3.11.2-6+deb12u6

lib-argparse.diff Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Description: Debian: Degrade argparse gracefully without gettext
 python3.X-minimal includes argparse but not gettext. Use a fallback noop
 gettext, if it can't be imported.

Forwarded: not-needed

--- a/Lib/argparse.py
+++ b/Lib/argparse.py
@@ -91,7 +91,16 @@
 
 import warnings
 
-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=='