From a181a3fb3585d647a8b4bdc13b282f292006ad37 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Mon, 25 Apr 2016 18:16:08 -0700 Subject: [PATCH] WrongPasswordError: display docstring in str() --- src/wormhole/errors.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wormhole/errors.py b/src/wormhole/errors.py index 898bafd..4d91270 100644 --- a/src/wormhole/errors.py +++ b/src/wormhole/errors.py @@ -1,4 +1,4 @@ -import functools +import functools, textwrap class ServerError(Exception): def __init__(self, message, relay): @@ -28,6 +28,8 @@ class WrongPasswordError(Exception): chance. """ # or the data blob was corrupted, and that's why decrypt failed + def __init__(self): + Exception.__init__(self, textwrap.dedent(self.__doc__.strip())) class ReflectionAttack(Exception): """An attacker (or bug) reflected our outgoing message back to us."""