[blivet:master 1/2] Match whole string, not substring.

Anne Mulhern amulhern at redhat.com
Wed Nov 19 12:25:19 UTC 2014





----- Original Message -----
> From: "Vratislav Podzimek" <vpodzime at redhat.com>
> To: "anaconda patch review" <anaconda-patches at lists.fedorahosted.org>
> Sent: Wednesday, November 19, 2014 2:21:45 AM
> Subject: Re: [blivet:master 1/2] Match whole string, not substring.
> 
> On Tue, 2014-11-18 at 18:09 -0500, mulhern wrote:
> > The expression on the right of the 'in' was being interpreted as a str
> > with some pointless parens around it. Now it is interpreted as a tuple.
> > 
> > Signed-off-by: mulhern <amulhern at redhat.com>
> > ---
> >  blivet/arch.py | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/blivet/arch.py b/blivet/arch.py
> > index 810ec1c..cd93d86 100644
> > --- a/blivet/arch.py
> > +++ b/blivet/arch.py
> > @@ -285,7 +285,7 @@ def isPPC(bits=None):
> >          if arch in ('ppc', 'ppc64', 'ppc64le'):
> >              return True
> >      elif bits == 32:
> > -        if arch in ('ppc'):
> > +        if arch in ('ppc',):
> Wouldn't it be better to use 'if arch == 'ppc':' here instead? I know
> the usage of 'in' is a common pattern in that code, but it just looks
> weird to me.
> 
> --
> Vratislav Podzimek
> 
> Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
> 
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> 

Changed!

- mulhern


More information about the anaconda-patches mailing list