[blivet:master 19/20] Slightly rewrite loop to avoid a redefining builtin error

Anne Mulhern amulhern at redhat.com
Tue Apr 15 13:10:27 UTC 2014





----- Original Message -----
> From: "Vratislav Podzimek" <vpodzime at redhat.com>
> To: "anaconda patch review" <anaconda-patches at lists.fedorahosted.org>
> Sent: Tuesday, April 15, 2014 2:25:33 AM
> Subject: Re: [blivet:master 19/20] Slightly rewrite loop to avoid a	redefining builtin error
> 
> On Mon, 2014-04-14 at 17:41 -0700, Brian C. Lane wrote:
> > On Fri, Apr 11, 2014 at 02:04:01PM -0400, mulhern wrote:
> > > More elegant than changing the name.
> > > 
> > > Signed-off-by: mulhern <amulhern at redhat.com>
> > > ---
> > >  blivet/iscsi.py | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/blivet/iscsi.py b/blivet/iscsi.py
> > > index 18b8c86..659bc3b 100644
> > > --- a/blivet/iscsi.py
> > > +++ b/blivet/iscsi.py
> > > @@ -220,8 +220,8 @@ class iscsi(object):
> > >          os.close(fd)
> > >          self.initiatorSet = True
> > >  
> > > -        for dir in
> > > ['ifaces','isns','nodes','send_targets','slp','static']:
> > > -            fulldir = "/var/lib/iscsi/%s" % (dir,)
> > > +        for fulldir in (os.path.join("/var/lib/iscsi", dir) for dir in \
> > 
> > Should use d here instead of dir
> Do we have the pylint check for one-char variables turned off? Otherwise
> it would complain. I'd suggest "dir_ent" or simply "item" or "name".
> 
> --
> 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 in working copy.

By default the C0103 analysis allows one char identifiers in list comprehensions.

http://pylint-messages.wikidot.com/messages:c0103.

- mulhern


More information about the anaconda-patches mailing list