aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/minstall.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/minstall.py')
-rw-r--r--mesonbuild/minstall.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/mesonbuild/minstall.py b/mesonbuild/minstall.py
index a645960..698feef 100644
--- a/mesonbuild/minstall.py
+++ b/mesonbuild/minstall.py
@@ -566,10 +566,13 @@ class Installer:
if rootcmd is not None:
print('Installation failed due to insufficient permissions.')
- ans = input(f'Attempt to use {rootcmd} to gain elevated privileges? [y/n] ')
- if ans not in {'y', 'n'}:
+ for attempt in range(5):
+ ans = input(f'Attempt to use {rootcmd} to gain elevated privileges? [y/n] ')
+ if ans in {'y', 'n'}:
+ break
+ else:
raise MesonException('Answer not one of [y/n]')
- elif ans == 'y':
+ if ans == 'y':
os.execlp(rootcmd, rootcmd, sys.executable, main_file, *sys.argv[1:],
'-C', os.getcwd(), '--no-rebuild')
raise