Skip to content

Commit

Permalink
fixed Python 3 compatibility in pdtLocale_icu
Browse files Browse the repository at this point in the history
  • Loading branch information
Nandor Devai committed Jun 24, 2014
1 parent 9f8af90 commit 29c5c89
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion parsedatetime/pdt_locales.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ def __init__(self, localeID):
if self.icu is not None:
# grab spelled out format of all numbers from 0 to 100
rbnf = pyicu.RuleBasedNumberFormat(pyicu.URBNFRuleSetTag.SPELLOUT, self.icu)
self.numbers = dict([(rbnf.format(i), i) for i in xrange(0, 100)])
try:
self.numbers = dict([(rbnf.format(i), i) for i in xrange(0, 100)])
except NameError:
self.numbers = dict([(rbnf.format(i), i) for i in range(0, 100)])

self.symbols = pyicu.DateFormatSymbols(self.icu)

Expand Down

0 comments on commit 29c5c89

Please sign in to comment.