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.
This commit is contained in:
Richard W.M. Jones
2012-04-17 17:41:43 +01:00
parent 7995c513ba
commit 255882a3f6
4 changed files with 4 additions and 4 deletions

View File

@@ -58,4 +58,4 @@ g.upload ("/etc/resolv.conf", "/foo/resolv.conf")
# Because 'autosync' was set (above) we can just close the handle
# and the disk contents will be synchronized. You can also do
# this manually by calling g.umount_all and g.sync.
del g
g.close ()