Skip to content

Commit b4619f0

Browse files
committed
relax guards
1 parent a14a08a commit b4619f0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/importlib/_bootstrap_external.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,10 @@ def _write_atomic(path, data, mode=0o666):
212212
with _io.FileIO(fd, 'wb') as file:
213213
file.write(data)
214214
_os.replace(path_tmp, path)
215-
except (OSError, ValueError):
215+
except OSError:
216216
try:
217217
_os.unlink(path_tmp)
218-
except (OSError, ValueError):
218+
except OSError:
219219
pass
220220
raise
221221

@@ -1267,7 +1267,7 @@ def set_data(self, path, data, *, _mode=0o666):
12671267
return
12681268
try:
12691269
_write_atomic(path, data, _mode)
1270-
except (OSError, ValueError) as exc:
1270+
except OSError as exc:
12711271
# Same as above: just don't write the bytecode.
12721272
_bootstrap._verbose_message('could not create {!r}: {!r}', path,
12731273
exc)

0 commit comments

Comments
 (0)