Skip to content
Snippets Groups Projects
Commit dd767cc6 authored by Chris Lamb's avatar Chris Lamb :eyes:
Browse files

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

parent ea5dc2ca
No related branches found
No related tags found
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment