Remove code for unsupported Python versions

This commit is contained in:
hugovk
2017-10-10 08:54:56 +03:00
parent dd45f8ba6c
commit ef732fc51d
23 changed files with 44 additions and 107 deletions

View File

@@ -453,8 +453,7 @@ def raises(expected_exception, *args, **kwargs):
This helper produces a ``ExceptionInfo()`` object (see below).
If using Python 2.5 or above, you may use this function as a
context manager::
You may use this function as a context manager::
>>> with raises(ZeroDivisionError):
... 1/0
@@ -609,13 +608,6 @@ class RaisesContext(object):
__tracebackhide__ = True
if tp[0] is None:
fail(self.message)
if sys.version_info < (2, 7):
# py26: on __exit__() exc_value often does not contain the
# exception value.
# http://bugs.python.org/issue7853
if not isinstance(tp[1], BaseException):
exc_type, value, traceback = tp
tp = exc_type, exc_type(value), traceback
self.excinfo.__init__(tp)
suppress_exception = issubclass(self.excinfo.type, self.expected_exception)
if sys.version_info[0] == 2 and suppress_exception: