summaryrefslogtreecommitdiffstats
path: root/Lib/locale.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/locale.py')
-rw-r--r--Lib/locale.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/locale.py b/Lib/locale.py
index 2f8cd85..0bed19e 100644
--- a/Lib/locale.py
+++ b/Lib/locale.py
@@ -13,6 +13,7 @@
import sys, encodings, encodings.aliases
from builtins import str as _builtin_str
+import functools
# Try importing the _locale module.
#
@@ -94,6 +95,21 @@ if 'strxfrm' not in globals():
if 'strcoll' not in globals():
strcoll = _strcoll
+
+_localeconv = localeconv
+
+# With this dict, you can override some items of localeconv's return value.
+# This is useful for testing purposes.
+_override_localeconv = {}
+
+@functools.wraps(_localeconv)
+def localeconv():
+ d = _localeconv()
+ if _override_localeconv:
+ d.update(_override_localeconv)
+ return d
+
+
### Number formatting APIs
# Author: Martin von Loewis