diff options
Diffstat (limited to 'examples/domsave.py')
-rwxr-xr-x | examples/domsave.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/domsave.py b/examples/domsave.py index 4940cce..f8922d6 100755 --- a/examples/domsave.py +++ b/examples/domsave.py @@ -18,8 +18,9 @@ if len(sys.argv) != 2: dir = sys.argv[1] -conn = libvirt.open(None) -if conn is None: +try: + conn = libvirt.open(None) +except libvirt.libvirtError: print('Failed to open connection to the hypervisor') sys.exit(1) |