diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2019-07-19 21:41:58 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2019-07-19 21:41:58 -0400 |
commit | 0a93630dc92de59194794f5f0b9ae1987157f327 (patch) | |
tree | 0b4e37ac38aba2f8a3a46a0bfcecaed2d7209a34 /coverage/backward.py | |
parent | e4054498c6eb2f0b97de80bcf9835f416a91207c (diff) | |
download | python-coveragepy-git-0a93630dc92de59194794f5f0b9ae1987157f327.tar.gz |
z-compressed dumps and loads
Diffstat (limited to 'coverage/backward.py')
-rw-r--r-- | coverage/backward.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/coverage/backward.py b/coverage/backward.py index 720cd3e1..0df2a41e 100644 --- a/coverage/backward.py +++ b/coverage/backward.py @@ -106,6 +106,10 @@ if env.PY3: """Convert string `s` to bytes.""" return s.encode('utf8') + def to_string(b): + """Convert bytes `b` to string.""" + return b.decode('utf8') + def binary_bytes(byte_values): """Produce a byte string with the ints from `byte_values`.""" return bytes(byte_values) @@ -120,6 +124,10 @@ else: """Convert string `s` to bytes (no-op in 2.x).""" return s + def to_string(b): + """Convert bytes `b` to string.""" + return b + def binary_bytes(byte_values): """Produce a byte string with the ints from `byte_values`.""" return "".join(chr(b) for b in byte_values) |