From e96ef93d18831630687b6c026bed89a1f9149c90 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 1 May 2021 13:46:29 -0400 Subject: refactor: remove unneeded backward.py shims Removed were: - StringIO - configparser - string_class - unicode_class - range - zip_longest - get_thread_id - path_types - shlex_quote - reprlib --- coverage/misc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'coverage/misc.py') diff --git a/coverage/misc.py b/coverage/misc.py index 44d1cdf8..148f42e1 100644 --- a/coverage/misc.py +++ b/coverage/misc.py @@ -16,7 +16,7 @@ import sys import types from coverage import env -from coverage.backward import to_bytes, unicode_class +from coverage.backward import to_bytes ISOLATED_MODULES = {} @@ -71,7 +71,7 @@ if USE_CONTRACTS: # Define contract words that PyContract doesn't have. new_contract('bytes', lambda v: isinstance(v, bytes)) - new_contract('unicode', lambda v: isinstance(v, unicode_class)) + new_contract('unicode', lambda v: isinstance(v, str)) def one_of(argnames): """Ensure that only one of the argnames is non-None.""" @@ -204,7 +204,7 @@ class Hasher(object): def update(self, v): """Add `v` to the hash, recursively if needed.""" self.md5.update(to_bytes(str(type(v)))) - if isinstance(v, unicode_class): + if isinstance(v, str): self.md5.update(v.encode('utf8')) elif isinstance(v, bytes): self.md5.update(v) -- cgit v1.2.1