8000 Add lock for thread safety · python/cpython@f5325ad · GitHub
[go: up one dir, main page]

Skip to content

Commit f5325ad

Browse files
committed
Add lock for thread safety
1 parent 3911f21 commit f5325ad

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/zipfile/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1893,7 +1893,8 @@ def remove(self, zinfo_or_arcname):
18931893
# get the info object
18941894
zinfo = self.getinfo(zinfo_or_arcname)
18951895

1896-
return self._remove_members({zinfo})
1896+
with self._lock:
1897+
return self._remove_members({zinfo})
18971898

18981899
@classmethod
18991900
def _sanitize_windows_name(cls, arcname, pathsep):

0 commit comments

Comments
 (0)
0