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

Vinson Lee vlee at freedesktop.org
Sat May 7 07:15:30 UTC 2016


On Fri, May 6, 2016 at 1:07 PM, Dylan Baker <dylan at pnwbakers.com> wrote:
> 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
>

Reviewed-by: Vinson Lee <vlee at freedesktop.org>


More information about the Piglit mailing list