[PATCH libvirt-python v2 05/22] event-test.py: Use __file__

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



instead of sys.argv[0]

Signed-off-by: Philipp Hahn <hahn@xxxxxxxxxxxxx>
---
 examples/event-test.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/event-test.py b/examples/event-test.py
index 646ce50..ab1da4a 100755
--- a/examples/event-test.py
+++ b/examples/event-test.py
@@ -667,7 +667,7 @@ def myConnectionCloseCallback(conn, reason, opaque):
     run = False
 
 def usage():
-    print("usage: "+os.path.basename(sys.argv[0])+" [-hdl] [uri]")
+    print("usage: %s [-hdl] [uri]" % (os.path.basename(__file__),))
     print("   uri will default to qemu:///system")
     print("   --help, -h   Print this help message")
     print("   --debug, -d  Print debug output")
-- 
2.11.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux