Skip to content

Commit 978bed3

Browse files
committed
Suppress Babel warning. Closes wireservice#665.
1 parent 55a42aa commit 978bed3

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

CHANGELOG.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
1.5.6
22
-----
3+
4+
* Suppress warning from babel about Time Zone expressions on Python 3.6. (#665)
35
* Reimplemented slugify with python-slugify instead of awesome-slugify. (#660)
46
* Slugify renaming of duplicate values is now consistent with :meth:`.Table.init`. (#615)
57

6-
78
1.5.5 - December 29, 2016
89
-------------------------
910

agate/data_types/number.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
except ImportError: # pragma: no cover
77
from decimal import Decimal, InvalidOperation
88

9+
import warnings
10+
911
from babel.core import Locale
1012
import six
1113

@@ -41,8 +43,14 @@ def __init__(self, locale='en_US', group_symbol=None, decimal_symbol=None, curre
4143
self.locale = Locale.parse(locale)
4244

4345
self.currency_symbols = currency_symbols
44-
self.group_symbol = group_symbol or self.locale.number_symbols.get('group', ',')
45-
self.decimal_symbol = decimal_symbol or self.locale.number_symbols.get('decimal', '.')
46+
47+
# Suppress Babel warning on Python 3.6
48+
# See #665
49+
with warnings.catch_warnings():
50+
warnings.simplefilter("ignore")
51+
52+
self.group_symbol = group_symbol or self.locale.number_symbols.get('group', ',')
53+
self.decimal_symbol = decimal_symbol or self.locale.number_symbols.get('decimal', '.')
4654

4755
def cast(self, d):
4856
"""

0 commit comments

Comments
 (0)