mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
python: Set program name to the true name instead of 'python'.
As in commit e102bcf3cf (for Perl), any
Python program has the handle program name field set to 'python'. Set
it to the true name (derived from sys.argv[0]).
This commit is contained in:
@@ -671,6 +671,8 @@ logvols = g.lvs ()
|
||||
|
||||
\"\"\"
|
||||
|
||||
import os
|
||||
import sys
|
||||
import libguestfsmod
|
||||
|
||||
";
|
||||
@@ -714,6 +716,10 @@ class GuestFS(object):
|
||||
self._o = libguestfsmod.create (flags)
|
||||
self._python_return_dict = python_return_dict
|
||||
|
||||
# If we don't do this, the program name is always set to 'python'.
|
||||
program = os.path.basename (sys.argv[0])
|
||||
libguestfsmod.set_program (self._o, program)
|
||||
|
||||
def __del__ (self):
|
||||
if self._o:
|
||||
libguestfsmod.close (self._o)
|
||||
|
||||
Reference in New Issue
Block a user