[libvirt] [PATCH libvirt-python v2 04/22] event-test.py: Add missing globale statement

Philipp Hahn posted 22 patches 6 years, 2 months ago
[libvirt] [PATCH libvirt-python v2 04/22] event-test.py: Add missing globale statement
Posted by Philipp Hahn 6 years, 2 months ago
to fix loop termination on exit.

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

diff --git a/examples/event-test.py b/examples/event-test.py
index 1f34930..646ce50 100755
--- a/examples/event-test.py
+++ b/examples/event-test.py
@@ -663,6 +663,7 @@ def myConnectionCloseCallback(conn, reason, opaque):
         "Error", "End-of-file", "Keepalive", "Client",
         )
     print("myConnectionCloseCallback: %s: %s" % (conn.getURI(), reasonStrings[reason]))
+    global run
     run = False
 
 def usage():
-- 
2.11.0

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