summaryrefslogtreecommitdiff
path: root/pygnulib/constants.py
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2022-07-31 21:08:55 +0200
committerBruno Haible <bruno@clisp.org>2022-07-31 23:52:50 +0200
commite3d8f648354446ba56b4fb95eef9f3841b669806 (patch)
treedb181e8bfcc75bf328914cfa3936d35b497e8621 /pygnulib/constants.py
parent9d5acb8d7ebb11ad90861bbae95dff01ad156085 (diff)
downloadgnulib-e3d8f648354446ba56b4fb95eef9f3841b669806.tar.gz
gnulib-tool.py: Implement options --symlink and --local-symlink.
* gnulib-tool.py (main): Handle options --symlink and --local-symlink. * pygnulib/constants.py (link_if_changed): Ignore FileNotFoundError from os.remove call.
Diffstat (limited to 'pygnulib/constants.py')
-rw-r--r--pygnulib/constants.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pygnulib/constants.py b/pygnulib/constants.py
index 9ef2e01089..10bd363f5b 100644
--- a/pygnulib/constants.py
+++ b/pygnulib/constants.py
@@ -330,7 +330,10 @@ def link_if_changed(src, dest):
'''Create a symlink, but avoids munging timestamps if the link is correct.'''
ln_target = os.path.realpath(src)
if not (os.path.islink(dest) and src == ln_target):
- os.remove(dest)
+ try:
+ os.remove(dest)
+ except FileNotFoundError:
+ pass
link_relative(src, dest)