#1060 Call .decode() only for binary data

Open Lumír 'Frenzy' Balhar frenzymadness
Showing 1 of 1 files from the diff.

@@ -60,14 +60,8 @@
Loading
60 60
    _split_decimal = re.compile("([.,])")
61 61
62 62
    def __init__(self, instream):
63 -
        if six.PY2:
64 -
            # In Python 2, we can't duck type properly because unicode has
65 -
            # a 'decode' function, and we'd be double-decoding
66 -
            if isinstance(instream, (bytes, bytearray)):
67 -
                instream = instream.decode()
68 -
        else:
69 -
            if getattr(instream, 'decode', None) is not None:
70 -
                instream = instream.decode()
63 +
        if isinstance(instream, (bytes, bytearray)) or six.PY3 and isinstance(instream, memoryview):
64 +
            instream = instream.decode()
71 65
72 66
        if isinstance(instream, text_type):
73 67
            instream = StringIO(instream)

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
dateutil -<.01% 95.99%
Project Totals (32 files) 95.99%
Loading