Skip to content

Commit 2c28baf

Browse files
committed
call on_access in _MemoryFile next and readlines methods
1 parent 05883f8 commit 2c28baf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/memoryfs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ def __iter__(self):
108108
def next(self):
109109
# type: () -> bytes
110110
with self._seek_lock():
111+
self.on_access()
111112
return next(self._bytes_io)
112113

113114
__next__ = next
@@ -148,6 +149,7 @@ def readinto(self, b):
148149
def readlines(self, hint=-1):
149150
# type: (int) -> List[bytes]
150151
with self._seek_lock():
152+
self.on_access()
151153
return self._bytes_io.readlines(hint)
152154

153155
def seekable(self):

0 commit comments

Comments
 (0)