From 255882a3f615c7727d2cc2f18f692513dc0a75e9 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 17 Apr 2012 17:41:43 +0100 Subject: 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. --- python/t/010-basic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python/t/010-basic.py') diff --git a/python/t/010-basic.py b/python/t/010-basic.py index 63bd6172..a97f3d24 100644 --- a/python/t/010-basic.py +++ b/python/t/010-basic.py @@ -31,6 +31,6 @@ g.lvcreate ("LV1", "VG", 200) g.lvcreate ("LV2", "VG", 200) if (g.lvs () != ["/dev/VG/LV1", "/dev/VG/LV2"]): raise "Error: g.lvs() returned incorrect result" -del g +g.close () os.unlink ("test.img") -- cgit