diff options
Diffstat (limited to 'netlib/encoding.py')
-rw-r--r-- | netlib/encoding.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/netlib/encoding.py b/netlib/encoding.py index 29e2a420..da282194 100644 --- a/netlib/encoding.py +++ b/netlib/encoding.py @@ -33,6 +33,7 @@ def decode(encoded, encoding, errors='strict'): """ global _cache cached = ( + isinstance(encoded, bytes) and _cache.encoded == encoded and _cache.encoding == encoding and _cache.errors == errors @@ -68,6 +69,7 @@ def encode(decoded, encoding, errors='strict'): """ global _cache cached = ( + isinstance(decoded, bytes) and _cache.decoded == decoded and _cache.encoding == encoding and _cache.errors == errors |