Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates import #11

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions deux/notifications.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
from __future__ import absolute_import, unicode_literals

from twilio.rest import TwilioRestClient
from twilio.rest.exceptions import TwilioRestException
try:
from twilio.rest import Client as TwilioRestClient
except ImportError:
from twilio.rest import TwilioRestClient
print("DeprecationWarning: Importing TwilioRestClient from twilio.rest"
" is deprecated. Update twilio package to >6.x")

try:
from twilio.base.exceptions import TwilioRestException
except ImportError:
from twilio.rest.exceptions import TwilioRestException
print("DeprecationWarning: Importing TwilioRestException from twilio.rest"
" is deprecated. Update twilio package to >6.x")

from deux import strings
from deux.app_settings import mfa_settings
Expand Down
8 changes: 7 additions & 1 deletion deux/tests/test_notifications.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
from __future__ import absolute_import, unicode_literals

from mock import Mock, patch
from twilio.rest.exceptions import TwilioRestException

try:
from twilio.base.exceptions import TwilioRestException
except ImportError:
from twilio.rest.exceptions import TwilioRestException
print("DeprecationWarning: Importing TwilioRestException from twilio.rest"
" is deprecated. Update twilio package to >6.x")

from deux.app_settings import mfa_settings
from deux.exceptions import InvalidPhoneNumberError, TwilioMessageError
Expand Down