From 08d56e24b088be004e432a8d22d2ddea0556efa1 Mon Sep 17 00:00:00 2001 From: Philipp Hahn Date: Wed, 12 Oct 2011 16:54:40 +0200 Subject: [PATCH] example: Fix argument handling sys.argv contains the original command line arguments, while args only contains the arguments not handled by getopt(). Currently this is no problem since --help is the only command line option passable, which terminates the process, so the code is never reached. Any option added in the future will reveal the bug. Signed-off-by: Philipp Hahn --- examples/domain-events/events-python/event-test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/domain-events/events-python/event-test.py b/examples/domain-events/events-python/event-test.py index 76fda2bb4d..9018366512 100644 --- a/examples/domain-events/events-python/event-test.py +++ b/examples/domain-events/events-python/event-test.py @@ -486,8 +486,8 @@ def main(): usage() sys.exit() - if len(sys.argv) > 1: - uri = sys.argv[1] + if len(args) >= 1: + uri = args[0] else: uri = "qemu:///system" -- 2.39.5