Browse files

add note about Python 2.x/3.x compatibility and patch up test suite t…

…o run under Python 3
  • Loading branch information...
1 parent 8035a32 commit c88af28dc11b52c471d2d0bbf1ce1a8418c8aa39 @rholder committed Mar 20, 2013
Showing with 8 additions and 3 deletions.
  1. +8 −3
@@ -162,11 +162,16 @@ def go(self):
raise NameError()
return True
-class CustomError:
+class CustomError(Exception):
- This is a custom exception class that doesn't inherit from any of the Python base Exception hierarchy.
+ This is a custom exception class. Note that For Python 2.x, we don't
+ strictly need to extend BaseException, however, Python 3.x will complain.
+ While this test suite won't run correctly under Python 3.x without
+ extending from the Python exception hierarchy, the actual module code is
+ backwards compatible Python 2.x and will allow for cases where exception
+ classes don't extend from the hierarchy.
def __init__(self, value):
self.value = value

0 comments on commit c88af28

Please sign in to comment.