Skip to content

Commit

Permalink
Suppress Babel warning. Closes #665.
Browse files Browse the repository at this point in the history
  • Loading branch information
onyxfish committed Feb 27, 2017
1 parent 55a42aa commit 978bed3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
1.5.6
-----

* Suppress warning from babel about Time Zone expressions on Python 3.6. (#665)
* Reimplemented slugify with python-slugify instead of awesome-slugify. (#660)
* Slugify renaming of duplicate values is now consistent with :meth:`.Table.init`. (#615)


1.5.5 - December 29, 2016
-------------------------

Expand Down
12 changes: 10 additions & 2 deletions agate/data_types/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
except ImportError: # pragma: no cover
from decimal import Decimal, InvalidOperation

import warnings

from babel.core import Locale
import six

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

self.currency_symbols = currency_symbols
self.group_symbol = group_symbol or self.locale.number_symbols.get('group', ',')
self.decimal_symbol = decimal_symbol or self.locale.number_symbols.get('decimal', '.')

# Suppress Babel warning on Python 3.6
# See #665
with warnings.catch_warnings():
warnings.simplefilter("ignore")

self.group_symbol = group_symbol or self.locale.number_symbols.get('group', ',')
self.decimal_symbol = decimal_symbol or self.locale.number_symbols.get('decimal', '.')

def cast(self, d):
"""
Expand Down

0 comments on commit 978bed3

Please sign in to comment.