summaryrefslogtreecommitdiff
path: root/passlib
diff options
context:
space:
mode:
authorEli Collins <elic@assurancetechnologies.com>2011-03-28 01:55:33 -0400
committerEli Collins <elic@assurancetechnologies.com>2011-03-28 01:55:33 -0400
commitb4e35f77798ee08fdae97363f35704432bcfbc6e (patch)
treee39a9de6b2823f569326c2b0433206a10cc2958d /passlib
parent929f59a76b45ecd3101f5609493f3dd6e1fcd723 (diff)
downloadpasslib-b4e35f77798ee08fdae97363f35704432bcfbc6e.tar.gz
more error statements rewritten
Diffstat (limited to 'passlib')
-rw-r--r--passlib/context.py2
-rw-r--r--passlib/handlers/digests.py2
-rw-r--r--passlib/handlers/ldap_digests.py6
-rw-r--r--passlib/handlers/misc.py2
-rw-r--r--passlib/handlers/postgres.py2
5 files changed, 7 insertions, 7 deletions
diff --git a/passlib/context.py b/passlib/context.py
index 4ac3e00..99bc372 100644
--- a/passlib/context.py
+++ b/passlib/context.py
@@ -583,7 +583,7 @@ class CryptPolicy(object):
## p = ConfigParser()
## if update and os.path.exists(path):
## if not p.read([path]):
- ## raise EnvironmentError, "failed to read existing file"
+ ## raise EnvironmentError("failed to read existing file")
## p.remove_section(section)
## self._write_to_parser(p, section)
## fh = file(path, "w")
diff --git a/passlib/handlers/digests.py b/passlib/handlers/digests.py
index 4681be3..e05f547 100644
--- a/passlib/handlers/digests.py
+++ b/passlib/handlers/digests.py
@@ -42,7 +42,7 @@ class HexDigestHash(SimpleHandler):
@classmethod
def genhash(cls, secret, hash):
if secret is None:
- raise TypeError, "no secret provided"
+ raise TypeError("no secret provided")
if isinstance(secret, unicode):
secret = secret.encode("utf-8")
if hash is not None and not cls.identify(hash):
diff --git a/passlib/handlers/ldap_digests.py b/passlib/handlers/ldap_digests.py
index 7acc2e2..a55d325 100644
--- a/passlib/handlers/ldap_digests.py
+++ b/passlib/handlers/ldap_digests.py
@@ -40,7 +40,7 @@ class _Base64DigestHelper(SimpleHandler):
@classmethod
def genhash(cls, secret, hash):
if secret is None:
- raise TypeError, "no secret provided"
+ raise TypeError("no secret provided")
if isinstance(secret, unicode):
secret = secret.encode("utf-8")
if hash is not None and not cls.identify(hash):
@@ -78,7 +78,7 @@ class _SaltedBase64DigestHelper(ExtendedHandler):
def calc_checksum(self, secret):
if secret is None:
- raise TypeError, "no secret provided"
+ raise TypeError("no secret provided")
if isinstance(secret, unicode):
secret = secret.encode("utf-8")
return self._hash(secret + self.salt).digest()
@@ -170,7 +170,7 @@ class ldap_plaintext(SimpleHandler):
if hash is not None and not cls.identify(hash):
raise ValueError("not a valid ldap_cleartext hash")
if secret is None:
- raise TypeError, "secret must be string"
+ raise TypeError("secret must be string")
if isinstance(secret, unicode):
secret = secret.encode("utf-8")
return secret
diff --git a/passlib/handlers/misc.py b/passlib/handlers/misc.py
index 612929d..14126fb 100644
--- a/passlib/handlers/misc.py
+++ b/passlib/handlers/misc.py
@@ -73,7 +73,7 @@ class plaintext(SimpleHandler):
@classmethod
def genhash(cls, secret, hash):
if secret is None:
- raise TypeError, "secret must be string"
+ raise TypeError("secret must be string")
if isinstance(secret, unicode):
secret = secret.encode("utf-8")
return secret
diff --git a/passlib/handlers/postgres.py b/passlib/handlers/postgres.py
index 0e8bb33..958d027 100644
--- a/passlib/handlers/postgres.py
+++ b/passlib/handlers/postgres.py
@@ -66,7 +66,7 @@ class postgres_md5(object):
def encrypt(cls, secret, user):
#FIXME: not sure what postgres' policy is for unicode
if not user:
- raise ValueError, "user keyword must be specified for this algorithm"
+ raise ValueError("user keyword must be specified for this algorithm")
if isinstance(secret, unicode):
secret = secret.encode("utf-8")
if isinstance(user, unicode):