Source code elsie/utils/files.py

1
2
3
4
5
6
7
8
def read_helper(source):
    if isinstance(source, str):
        with open(source, "rb") as f:
            return f.read()
    elif isinstance(source, bytes):
        return source
    else:
        return source.read()