[PATCH] python: simplify complicated conditional assignment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Claudio Bley <cbley@xxxxxxxxxx>
---
Just noticed this while reading the generated .py files.

Might save a few cycles eventually...

 python/generator.py |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/python/generator.py b/python/generator.py
index 427cebc..10390c3 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -1455,8 +1455,7 @@ def buildWrappers(module):
                 elif classname in [ "virDomainSnapshot" ]:
                     classes.write("        self._dom = dom\n")
                     classes.write("        self._conn = dom.connect()\n")
-                classes.write("        if _obj != None:self._o = _obj;return\n")
-                classes.write("        self._o = None\n\n")
+                classes.write("        self._o = _obj\n\n")
             destruct=None
             if classes_destructors.has_key(classname):
                 classes.write("    def __del__(self):\n")
-- 
1.7.9.5

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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]