From 43358290b340349340deaaca40d07dc4cfb35540 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Wed, 4 May 2016 15:54:22 +0200 Subject: [PATCH] python: PEP 8: miscellaneous coding fixes python/guestfs.py:136:37: E712 comparison to True should be 'if cond is True:' or 'if cond:' python/t/tests_helper.py:42:8: E713 test for membership should be 'not in' No functional changes, as the new versions follow the suggested Python coding style to do the same things. --- generator/python.ml | 2 +- python/t/tests_helper.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/generator/python.ml b/generator/python.ml index 70dc076a5..9744b8f1c 100644 --- a/generator/python.ml +++ b/generator/python.ml @@ -738,7 +738,7 @@ class GuestFS(object): raise ClosedHandle(\"GuestFS: method called on closed handle\") def _maybe_convert_to_dict(self, r): - if self._python_return_dict == True: + if self._python_return_dict: r = dict(r) return r diff --git a/python/t/tests_helper.py b/python/t/tests_helper.py index 8493c40e8..4ae1375ae 100644 --- a/python/t/tests_helper.py +++ b/python/t/tests_helper.py @@ -39,7 +39,7 @@ def skipUnlessLibvirtHasCPointer(): return unittest.skip("could not import libvirt") # Check we're using the version of libvirt-python that has # c_pointer() methods. - if not "c_pointer" in dir(libvirt.open(None)): + if "c_pointer" not in dir(libvirt.open(None)): return unittest.skip("libvirt-python doesn't support c_pointer()") return lambda func: func