[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[bridgedb/develop] PEP8: use `except … as …` syntax in EmailServer.getMailResponse().
commit 37d144d2c581b43ca73b47fb47cd1b6597a5235c
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date: Wed Feb 12 15:24:53 2014 +0000
PEP8: use `except â?¦ as â?¦` syntax in EmailServer.getMailResponse().
---
lib/bridgedb/EmailServer.py | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/lib/bridgedb/EmailServer.py b/lib/bridgedb/EmailServer.py
index 5fa550d..7d54b4e 100644
--- a/lib/bridgedb/EmailServer.py
+++ b/lib/bridgedb/EmailServer.py
@@ -186,9 +186,9 @@ def getMailResponse(lines, ctx):
bridgeFilterRules=bridgeFilterRules)
# Handle rate limited email
- except TooSoonEmail, e:
- logging.info("Got a mail too frequently; warning %r: %s.",
- util.logSafely(clientAddr), e)
+ except TooSoonEmail as err:
+ logging.info("Got a mail too frequently; warning '%s': %s."
+ % (util.logSafely(clientAddr), err))
# Compose a warning email
# MAX_EMAIL_RATE is in seconds, convert to hours
@@ -196,14 +196,14 @@ def getMailResponse(lines, ctx):
return composeEmail(ctx.fromAddr, clientAddr, subject, body, msgID,
gpgContext=ctx.gpgContext)
- except IgnoreEmail, e:
- logging.info("Got a mail too frequently; ignoring %r: %s.",
- util.logSafely(clientAddr), e)
+ except IgnoreEmail as err:
+ logging.info("Got a mail too frequently; ignoring '%s': %s."
+ % (util.logSafely(clientAddr), err))
return None, None
- except BadEmail, e:
- logging.info("Got a mail from a bad email address %r: %s.",
- util.logSafely(clientAddr), e)
+ except BadEmail as err:
+ logging.info("Got a mail from a bad email address '%s': %s."
+ % (util.logSafely(clientAddr), err))
return None, None
if bridges:
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits