diff options
Diffstat (limited to 'Lib/locale.py')
-rw-r--r-- | Lib/locale.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/locale.py b/Lib/locale.py index 751353d..fd948a7 100644 --- a/Lib/locale.py +++ b/Lib/locale.py @@ -12,6 +12,7 @@ """ import sys, encodings, encodings.aliases +import functools # Try importing the _locale module. # @@ -87,6 +88,21 @@ except ImportError: """ return s + +_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 |