Babel is in requirements now

This commit is contained in:
Suren Khorenyan 2018-06-10 13:40:33 +03:00
parent 99bb5a9fef
commit b7a67cd522

View file

@ -1,12 +1,9 @@
import babel
from . import base
from . import fields
from ..utils import markdown
try:
import babel
except ImportError:
babel = None
class User(base.TelegramObject):
"""
@ -51,10 +48,7 @@ class User(base.TelegramObject):
This property requires `Babel <https://pypi.python.org/pypi/Babel>`_ module
:return: :class:`babel.core.Locale`
:raise: ImportError: when babel is not installed.
"""
if not babel:
raise ImportError('Babel is not installed!')
if not self.language_code:
return None
if not hasattr(self, '_locale'):