diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-04-17 17:41:43 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-04-17 17:41:43 +0100 |
commit | 255882a3f615c7727d2cc2f18f692513dc0a75e9 (patch) | |
tree | 8dd3a4b7b6548b404968f8a5ddbaec616649d54a /python/t/400-events.py | |
parent | 7995c513baf9929a1c5cefc30498a93b45eafd52 (diff) | |
download | libguestfs-255882a3f615c7727d2cc2f18f692513dc0a75e9.tar.gz libguestfs-255882a3f615c7727d2cc2f18f692513dc0a75e9.tar.xz libguestfs-255882a3f615c7727d2cc2f18f692513dc0a75e9.zip |
python: Remove 'del g' from the docs, replace with 'g.close ()'.
'del g' is a trap for the unwary. If the handle has any other
references, it does nothing (in fact, it can be actively dangerous if
the user was expecting the appliance to go away). In non-CPython it
can be delayed arbitrarily long.
Using 'g.close()' on the other hand is always safe.
Diffstat (limited to 'python/t/400-events.py')
-rw-r--r-- | python/t/400-events.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/python/t/400-events.py b/python/t/400-events.py index 9f96fb01..7e0fbc3b 100644 --- a/python/t/400-events.py +++ b/python/t/400-events.py @@ -53,6 +53,6 @@ g.set_autosync (1) # Close the handle. The close callback should be invoked. if close_invoked != 0: raise "Error: close_invoked should be 0" -del g +g.close () if close_invoked != 1: raise "Error: close_invoked should be 1" |