From: Collin Funk Date: Sun, 17 Mar 2024 03:43:00 +0000 (-0700) Subject: gnulib-tool.py: Don't try to remove files that don't exist. X-Git-Tag: v1.0~278 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=dc222376039df74093cd9a51384bbfd5657bec18;p=gnulib.git gnulib-tool.py: Don't try to remove files that don't exist. * pygnulib/GLFileSystem.py (GLFileSystem.add_or_update): Check if the temporary file exists before trying to remove it. --- diff --git a/ChangeLog b/ChangeLog index 9deed7d1d9..1f86609ac9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-03-17 Collin Funk + + gnulib-tool.py: Don't try to remove files that don't exist. + * pygnulib/GLFileSystem.py (GLFileSystem.add_or_update): Check if the + temporary file exists before trying to remove it. + 2024-03-16 Paul Eggert renameatu: support RENAME_EXCHANGE on macOS diff --git a/pygnulib/GLFileSystem.py b/pygnulib/GLFileSystem.py index 7c6c9a15ef..c199235e2e 100644 --- a/pygnulib/GLFileSystem.py +++ b/pygnulib/GLFileSystem.py @@ -395,7 +395,8 @@ class GLFileAssistant(object): # frequently that developers don't put autogenerated files under version control. self.add(lookedup, tmpflag, tmpfile) self.addFile(rewritten) - os.remove(tmpfile) + if isfile(tmpfile): + os.remove(tmpfile) def super_update(self, basename, tmpfile): '''GLFileAssistant.super_update(basename, tmpfile) -> tuple