Skip to content

Commit 558f81e

Browse files
committed
Catch setlocale exception
1 parent d14cdc9 commit 558f81e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

InteractiveHtmlBom/core/units.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
import locale
1616

1717
current_locale = locale.setlocale(locale.LC_NUMERIC)
18-
locale.setlocale(locale.LC_NUMERIC, '')
18+
try:
19+
locale.setlocale(locale.LC_NUMERIC, '')
20+
except Exception as ignore:
21+
# sometimes setlocale with empty string doesn't work on OSX
22+
pass
1923
decimal_separator = locale.localeconv()['decimal_point']
2024
locale.setlocale(locale.LC_NUMERIC, current_locale)
2125

0 commit comments

Comments
 (0)