python3.12/python-3.1.1-importlib-fix-handling-of-readonly-pyc-files.patch
2010-01-13 21:25:18 +00:00

13 lines
666 B
Diff

--- Lib/importlib/_bootstrap.py.fix-handling-of-readonly-pyc-files 2009-10-22 15:24:57.575015046 -0400
+++ Lib/importlib/_bootstrap.py 2009-10-22 15:25:24.024016069 -0400
@@ -522,8 +522,8 @@ class _PyPycFileLoader(PyPycLoader, _PyF
bytecode_path = self.bytecode_path(name)
if not bytecode_path:
bytecode_path = self._base_path + _suffix_list(imp.PY_COMPILED)[0]
- file = _io.FileIO(bytecode_path, 'w') # Assuming bytes.
try:
+ file = _io.FileIO(bytecode_path, 'w') # Assuming bytes.
with _closing(file) as bytecode_file:
bytecode_file.write(data)
return True