Show More
@@ -449,8 +449,8 b' def mmapread(fp, size=None):' | |||||
449 | return b'' |
|
449 | return b'' | |
450 | elif size is None: |
|
450 | elif size is None: | |
451 | size = 0 |
|
451 | size = 0 | |
|
452 | fd = getattr(fp, 'fileno', lambda: fp)() | |||
452 | try: |
|
453 | try: | |
453 | fd = getattr(fp, 'fileno', lambda: fp)() |
|
|||
454 | return mmap.mmap(fd, size, access=mmap.ACCESS_READ) |
|
454 | return mmap.mmap(fd, size, access=mmap.ACCESS_READ) | |
455 | except ValueError: |
|
455 | except ValueError: | |
456 | # Empty files cannot be mmapped, but mmapread should still work. Check |
|
456 | # Empty files cannot be mmapped, but mmapread should still work. Check |
General Comments 0
You need to be logged in to leave comments.
Login now