]> git.phdru.name Git - m_lib.git/blobdiff - m_lib/net/sms.py
Raise Error(message) for Py3 compatibility
[m_lib.git] / m_lib / net / sms.py
index 9b7339001f1801fc0340b4adc3f6c008a160830a..c3df7373518a28f2a2e314fb2fc683670bab4955 100644 (file)
@@ -249,7 +249,7 @@ class SendmailTransport(EMailTransport):
 
       sendmail = self.find_sendmail()
       if not sendmail:
-         raise ValueError, "cannot find sendmail binary"
+         raise ValueError("cannot find sendmail binary")
       self.sendmail = sendmail
 
    def find_sendmail(self):
@@ -359,7 +359,7 @@ class BeeOnLine(CP1251HTTPTransport):
          reply_to=''):      # send reply to this e-mail
       Transport.__init__(self, phone, message)
       if mode not in ('GSM', 'DAMPS'):
-         raise ValueError, "mode (%s) must be either 'GSM' or 'DAMPS'" % mode
+         raise ValueError("mode (%s) must be either 'GSM' or 'DAMPS'" % mode)
       self.mode = mode
       self.transliterate = transliterate
       self.reply_to = reply_to
@@ -382,7 +382,7 @@ class BeeOnLine(CP1251HTTPTransport):
       elif prf == '7901':
          dict['network_code'] = '1'
       else:
-         raise RuntimeError, "incorrect combination of mode (%s) and prefix (%s)" % (self.mode, prf)
+         raise RuntimeError("incorrect combination of mode (%s) and prefix (%s)" % (self.mode, prf))
 
       dict['phone'] = self.phone[4:]
       dict['message'] = text
@@ -561,9 +561,9 @@ def Phone2Provider(phone):
    prefix = phone[1:4]
 
    if prefix in ("095", "901"): # 901 is being used by Beeline and SkyLink
-      raise SMSError, "unknown provider for phone %s" % phone
+      raise SMSError("unknown provider for phone %s" % phone)
 
    if Prefix2Provider.has_key(prefix):
       return Prefix2Provider[prefix]
 
-   raise SMSError, "bad prefix for phone %s" % phone
+   raise SMSError("bad prefix for phone %s" % phone)