os: os.read() should return immutable value suitable e.g. for hashing.

Converting bytearray to bytes is of course not memory-efficient, so
os.read() is good candidate for native implementation.
pull/26/head
Paul Sokolovsky 2015-04-09 22:39:47 +03:00
rodzic 568db3c1af
commit 10a4cfc757
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -158,7 +158,7 @@ def read(fd, n):
buf = bytearray(n)
r = read_(fd, buf, n)
check_error(r)
return buf[:r]
return bytes(buf[:r])
def write(fd, buf):
r = write_(fd, buf, len(buf))