diff options
Diffstat (limited to 'dodai/tools/himo.py')
-rw-r--r-- | dodai/tools/himo.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/dodai/tools/himo.py b/dodai/tools/himo.py index 60051a7..aa4da6c 100644 --- a/dodai/tools/himo.py +++ b/dodai/tools/himo.py | |||
@@ -22,6 +22,7 @@ import unicodedata | |||
22 | from htmlentitydefs import name2codepoint | 22 | from htmlentitydefs import name2codepoint |
23 | from htmlentitydefs import codepoint2name | 23 | from htmlentitydefs import codepoint2name |
24 | from decimal import Decimal as D | 24 | from decimal import Decimal as D |
25 | from dodai.exception import HimoAsciiError | ||
25 | 26 | ||
26 | class String2Himo(object): | 27 | class String2Himo(object): |
27 | """ | 28 | """ |
@@ -164,9 +165,7 @@ class Himo(unicode): | |||
164 | if num: | 165 | if num: |
165 | out.append(unichr(int(num, 16))) | 166 | out.append(unichr(int(num, 16))) |
166 | else: | 167 | else: |
167 | print char | 168 | raise HimoAsciiError(char) |
168 | raise HimoAsciiError("Unable to convert 'u{0}' "\ | ||
169 | "character to ascii".format(ord(char))) | ||
170 | return str(''.join(out)) | 169 | return str(''.join(out)) |
171 | 170 | ||
172 | class HimoAsciiError(Exception): | 171 | class HimoAsciiError(Exception): |