exceptions.py 396 B

1234567891011121314
  1. # -*- coding: utf-8 -*-
  2. from __future__ import unicode_literals
  3. class PinyinNotFoundException(Exception):
  4. #: 异常信息
  5. message = ''
  6. #: 不包含拼音的字符串
  7. chars = ''
  8. def __init__(self, chars):
  9. self.message = 'No pinyin found for character "{}"'.format(chars)
  10. self.chars = chars
  11. super(PinyinNotFoundException, self).__init__(self.message)