File: runpy.patch

package info (click to toggle)
azure-cli 2.77.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,142,284 kB
  • sloc: python: 1,847,634; sh: 1,342; makefile: 404; cs: 145; javascript: 74; sql: 37; xml: 21
file content (22 lines) | stat: -rw-r--r-- 669 bytes parent folder | download | duplicates (2)
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')