summaryrefslogtreecommitdiff
path: root/testtools/compat.py
diff options
context:
space:
mode:
authorDaniel Watkins <daniel@daniel-watkins.co.uk>2013-12-03 16:15:49 +0000
committerDaniel Watkins <daniel@daniel-watkins.co.uk>2013-12-03 16:35:28 +0000
commitdeedadf3750c16c2f26c5680a158ac96ca10ccd6 (patch)
tree79762959048211acead64382ab377770a128f2dd /testtools/compat.py
parentd1d84da96e280bbf073da66c7631d807d4a0d414 (diff)
downloadtesttools-deedadf3750c16c2f26c5680a158ac96ca10ccd6.tar.gz
Remove and relocate some now un-needed compatibility functions.
Diffstat (limited to 'testtools/compat.py')
-rw-r--r--testtools/compat.py28
1 files changed, 0 insertions, 28 deletions
diff --git a/testtools/compat.py b/testtools/compat.py
index 5502e0c..226a22b 100644
--- a/testtools/compat.py
+++ b/testtools/compat.py
@@ -88,34 +88,6 @@ else:
_u.__doc__ = __u_doc
-if sys.version_info > (2, 5):
- all = all
- _error_repr = BaseException.__repr__
- def isbaseexception(exception):
- """Return whether exception inherits from BaseException only"""
- return (isinstance(exception, BaseException)
- and not isinstance(exception, Exception))
-else:
- def all(iterable):
- """If contents of iterable all evaluate as boolean True"""
- for obj in iterable:
- if not obj:
- return False
- return True
- def _error_repr(exception):
- """Format an exception instance as Python 2.5 and later do"""
- return exception.__class__.__name__ + repr(exception.args)
- def isbaseexception(exception):
- """Return whether exception would inherit from BaseException only
-
- This approximates the hierarchy in Python 2.5 and later, compare the
- difference between the diagrams at the bottom of the pages:
- <http://docs.python.org/release/2.4.4/lib/module-exceptions.html>
- <http://docs.python.org/release/2.5.4/lib/module-exceptions.html>
- """
- return isinstance(exception, (KeyboardInterrupt, SystemExit))
-
-
# GZ 2011-08-24: Using isinstance checks like this encourages bad interfaces,
# there should be better ways to write code needing this.
if not issubclass(getattr(builtins, "bytes", str), str):