[Piglit] [PATCH 02/14] core.py: use 'in list' instead of a == b or a == c...

Dylan Baker dylan at pnwbakers.com
Fri May 6 20:07:12 UTC 2016


From: Dylan Baker <baker.dylan.c at gmail.com>

This is cleaner and idiomatic.

Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 framework/core.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/framework/core.py b/framework/core.py
index fe4e4a4..870a708 100644
--- a/framework/core.py
+++ b/framework/core.py
@@ -121,7 +121,7 @@ def checkDir(dirname, failifexists):
     try:
         os.stat(dirname)
     except OSError as e:
-        if e.errno == errno.ENOENT or e.errno == errno.ENOTDIR:
+        if e.errno in [errno.ENOENT, errno.ENOTDIR]:
             exists = False
 
     if exists and failifexists:
-- 
2.8.2



More information about the Piglit mailing list