fix common.load()

This commit is contained in:
Roman Zeyde
2014-07-04 18:33:12 +03:00
parent 1fe05dfe63
commit a5571d13d0
4 changed files with 5 additions and 6 deletions

View File

@@ -33,9 +33,8 @@ def to_byte(bits):
byte = int(np.dot(bits, bit_weights))
return chr(byte)
def load(fname):
data = open(fname, 'rb').read()
return loads(data)
def load(fileobj):
return loads(fileobj.read())
def loads(data):
x = np.fromstring(data, dtype='int16')