From 15683e6a375b762b2c5616a782201413e3886b47 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Thu, 30 Jul 2026 12:20:42 -0700 Subject: [PATCH] Handle symbolic links in create_entry_points.py When creating the entry points we need to first delete them, in case they are sym links (which they may be once #27401 lands). --- tools/maint/create_entry_points.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/maint/create_entry_points.py b/tools/maint/create_entry_points.py index ab9b144f21cc7..ead15389b2eda 100755 --- a/tools/maint/create_entry_points.py +++ b/tools/maint/create_entry_points.py @@ -72,7 +72,7 @@ def make_executable(filename): def maybe_remove(filename): - if os.path.exists(filename): + if os.path.lexists(filename): os.remove(filename) @@ -82,6 +82,7 @@ def read_file(filename): def write_file(filename, content): + maybe_remove(filename) with open(filename, 'w', encoding='utf-8') as f: f.write(content)