diff options
| author | Sebastian Thiel <byronimo@gmail.com> | 2014-11-13 18:46:49 +0100 |
|---|---|---|
| committer | Sebastian Thiel <byronimo@gmail.com> | 2014-11-13 18:46:49 +0100 |
| commit | 8ae4e9579a263684c6b760aec2869be480ff22ba (patch) | |
| tree | f0f3344ffb385a6d3202087a5cdebb7589792e37 /gitdb/utils/encoding.py | |
| parent | 641b64c9f48139cf06774805d32892012fb9b82d (diff) | |
| download | gitdb-8ae4e9579a263684c6b760aec2869be480ff22ba.tar.gz | |
reduced usage of force_bytes as clients are expected to pass bytes.
It was useful for debugging though, maybe an explicit type assertions would
help others ?
As 'others' will be gitpython, I suppose I can handle it myself
Diffstat (limited to 'gitdb/utils/encoding.py')
| -rw-r--r-- | gitdb/utils/encoding.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/gitdb/utils/encoding.py b/gitdb/utils/encoding.py index 617b51c..2d03ad3 100644 --- a/gitdb/utils/encoding.py +++ b/gitdb/utils/encoding.py @@ -7,7 +7,7 @@ else: string_types = (basestring, ) text_type = unicode -def force_bytes(data, encoding="utf-8"): +def force_bytes(data, encoding="ascii"): if isinstance(data, bytes): return data @@ -23,10 +23,6 @@ def force_text(data, encoding="utf-8"): if isinstance(data, string_types): return data.decode(encoding) - if not isinstance(data, bytes): - assert False, "Shouldn't be here" - data = force_bytes(data, encoding) - if compat.PY3: return text_type(data, encoding) else: |
