diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2016-10-17 15:15:22 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2016-10-17 15:18:47 +1300 |
commit | 8360f70024330eeeb5c53d29e4a05194f872b511 (patch) | |
tree | 6bbdcfe54fcce1e41660ca07c9470f42debdec5b /netlib/tutils.py | |
parent | 4918feb7252c76c95d85cd8b2b0334a22aaae274 (diff) | |
download | mitmproxy-8360f70024330eeeb5c53d29e4a05194f872b511.tar.gz mitmproxy-8360f70024330eeeb5c53d29e4a05194f872b511.tar.bz2 mitmproxy-8360f70024330eeeb5c53d29e4a05194f872b511.zip |
First-order conversion to Python3-only
- Zap various occurrences of Python2 in docs and scripts
- Remove six from netlib, and some other places where obvious project-wide
search and replace works.
Diffstat (limited to 'netlib/tutils.py')
-rw-r--r-- | netlib/tutils.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/netlib/tutils.py b/netlib/tutils.py index 452766d6..5f598fa9 100644 --- a/netlib/tutils.py +++ b/netlib/tutils.py @@ -4,7 +4,6 @@ import os import time import shutil from contextlib import contextmanager -import six import sys from netlib import utils, tcp, http @@ -31,20 +30,20 @@ def tmpdir(*args, **kwargs): def _check_exception(expected, actual, exc_tb): - if isinstance(expected, six.string_types): + if isinstance(expected, str): if expected.lower() not in str(actual).lower(): - six.reraise(AssertionError, AssertionError( + raise AssertionError( "Expected %s, but caught %s" % ( repr(expected), repr(actual) ) - ), exc_tb) + ) else: if not isinstance(actual, expected): - six.reraise(AssertionError, AssertionError( + raise AssertionError( "Expected %s, but caught %s %s" % ( expected.__name__, actual.__class__.__name__, repr(actual) ) - ), exc_tb) + ) def raises(expected_exception, obj=None, *args, **kwargs): |