Commit dd767cc6 authored by Chris Lamb's avatar Chris Lamb 💬

Move the documentation for maybe_decode into a docstring on the method itself.

parent ea5dc2ca
......@@ -404,10 +404,12 @@ class File(object, metaclass=abc.ABCMeta):
return difference
return self.compare_bytes(other, source)
# helper function to convert to bytes if necessary
def maybe_decode(s):
Helper function to convert to bytes if necessary.
if type(s) is bytes:
return s.decode('utf-8')
return s
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment