Permalink
Browse files

Fix OperationFailureMustLogin exception

Both its __init__() and __str__() incorrectly used

  super(OperationFailure, self)

to get the "base class instance" of 'self', but this returned instance
belonging to the base class of OperationFailure, which is Exception,
meaning it accidentally ended up bypassing its immediate base class.

Also, OperationFailureMustLogin.__str__() was completely redundant; it
meant to redirect to its immediate base class's __str__(), but the
easiest way to do that is of course to not override __str__() in the
first place.
  • Loading branch information...
1 parent 1b26661 commit 78af734b861a1f42a5381aec8e3ec165f280bb25 @jensl committed Apr 3, 2013
Showing with 4 additions and 5 deletions.
  1. +4 −5 operation/__init__.py
View
@@ -88,11 +88,10 @@ def __str__(self):
class OperationFailureMustLogin(OperationFailure):
def __init__(self):
- super(OperationFailure, self).__init__("mustlogin",
- "Login Required",
- "You have to sign in to perform this operation.")
- def __str__(self):
- return super(OperationFailure, self).__str__()
+ super(OperationFailureMustLogin, self).__init__(
+ "mustlogin",
+ "Login Required",
+ "You have to sign in to perform this operation.")
class TypeChecker:
"""\

0 comments on commit 78af734

Please sign in to comment.