1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
Author: Luca Boccassi <bluca@debian.org>
Forwarded: https://github.com/Azure/azure-cli/pull/21261
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1005251
Description: {az} use runpy instead of os.execl
python -m adds the current working directory to the start of sys.path,
which means running from say /tmp with a fake azure.py causes az to load
it and run it.
--- a/src/azure-cli/az
+++ b/src/azure-cli/az
@@ -1,5 +1,6 @@
#!/usr/bin/env python
+import runpy
import sys
import os
@@ -15,4 +16,4 @@
os.environ['AZ_INSTALLER'] = 'DEB'
-os.execl(sys.executable, sys.executable, '-m', 'azure.cli', *sys.argv[1:])
+runpy.run_module('azure.cli')
|