diff options
author | Hervé Cauwelier <github@bors-ltd.fr> | 2019-03-10 17:52:26 +0100 |
---|---|---|
committer | Hervé Cauwelier <github@bors-ltd.fr> | 2019-03-11 13:46:02 +0100 |
commit | 6f344b3816f948e36c875dace8478adc3260400b (patch) | |
tree | fbb813506a75c3f101d0a752b997d49011e8eaf3 /pint/formatting.py | |
parent | 334289eb09ae5b1c5eeed1adcca3539958d91b2a (diff) | |
download | pint-6f344b3816f948e36c875dace8478adc3260400b.tar.gz |
formatting: revert unwanted removal of positional
While this was a nice change in Python, babel locale data are still using positional formatting.
This should fix the test suite for us but it's a mystery the build is passing on the master branch.
This change was introduced in commit 546ddaae991fcae400db22f87e82fffdaf5b2316.
Diffstat (limited to 'pint/formatting.py')
-rw-r--r-- | pint/formatting.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pint/formatting.py b/pint/formatting.py index 787cfae..c71437a 100644 --- a/pint/formatting.py +++ b/pint/formatting.py @@ -149,7 +149,8 @@ def formatter(items, as_ratio=True, single_denominator=False, for _babel_length in [babel_length] + other_lengths: pat = unit_patterns.get(_key, {}).get(_babel_length, {}).get(plural) if pat is not None: - key = pat.replace('{}', '').strip() + # Don't remove this positional! This is the format used in Babel + key = pat.replace('{0}', '').strip() break division_fmt = compound_unit_patterns.get("per", {}).get(babel_length, division_fmt) power_fmt = '{}{}' |