Fix exception alias syntax

This commit is contained in:
Christopher Grebs 2014-01-05 19:06:12 -08:00 committed by Ben Firshman
parent bf8875d930
commit 3c91315426
2 changed files with 6 additions and 6 deletions

View File

@ -38,18 +38,18 @@ def main():
except KeyboardInterrupt: except KeyboardInterrupt:
log.error("\nAborting.") log.error("\nAborting.")
exit(1) exit(1)
except UserError, e: except UserError as e:
log.error(e.msg) log.error(e.msg)
exit(1) exit(1)
except NoSuchService, e: except NoSuchService as e:
log.error(e.msg) log.error(e.msg)
exit(1) exit(1)
except NoSuchCommand, e: except NoSuchCommand as e:
log.error("No such command: %s", e.command) log.error("No such command: %s", e.command)
log.error("") log.error("")
log.error("\n".join(parse_doc_section("commands:", getdoc(e.supercommand)))) log.error("\n".join(parse_doc_section("commands:", getdoc(e.supercommand))))
exit(1) exit(1)
except APIError, e: except APIError as e:
log.error(e.explanation) log.error(e.explanation)
exit(1) exit(1)

View File

@ -85,7 +85,7 @@ class SocketClient:
stream.flush() stream.flush()
else: else:
break break
except Exception, e: except Exception as e:
log.debug(e) log.debug(e)
def send_ws(self, socket, stream): def send_ws(self, socket, stream):
@ -101,7 +101,7 @@ class SocketClient:
else: else:
try: try:
socket.send(chunk) socket.send(chunk)
except Exception, e: except Exception as e:
if hasattr(e, 'errno') and e.errno == errno.EPIPE: if hasattr(e, 'errno') and e.errno == errno.EPIPE:
break break
else: else: