Skip to content

Commit 33692ab

Browse files
committed
call on_access in _MemoryFile next and readlines methods
1 parent df23bd9 commit 33692ab

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
@@ -113,6 +113,7 @@ def __iter__(self):
113113
def next(self):
114114
# type: () -> bytes
115115
with self._seek_lock():
116+
self.on_access()
116117
return next(self._bytes_io)
117118

118119
__next__ = next
@@ -153,6 +154,7 @@ def readinto(self, b):
153154
def readlines(self, hint=-1):
154155
# type: (int) -> List[bytes]
155156
with self._seek_lock():
157+
self.on_access()
156158
return self._bytes_io.readlines(hint)
157159

158160
def seekable(self):

0 commit comments

Comments
 (0)