Commit 2adcf933 by Sheng

Updated tests/utils.py

parent 85efc9e4
...@@ -41,7 +41,8 @@ def get_content_type(filename): ...@@ -41,7 +41,8 @@ def get_content_type(filename):
def read_file(path, encoding='utf-8'): def read_file(path, encoding='utf-8'):
data = open(path, 'rb').read() with open(path, 'rb') as f:
data = f.read()
if encoding is None: if encoding is None:
return data return data
return data.decode(encoding) return data.decode(encoding)
......
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