[PATCH] Do not return None from Size.__str__ (#869405)
Vratislav Podzimek
vpodzime at redhat.com
Wed Oct 31 08:32:10 UTC 2012
On Tue, 2012-10-30 at 08:35 -0700, Brian C. Lane wrote:
> On Mon, Oct 29, 2012 at 08:15:28PM +0100, Vratislav Podzimek wrote:
> > If no value is < 1000, return the value in YBs.
> >
> > Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
> > ---
> > pyanaconda/storage/size.py | 40 +++++++++++++++++++++-------------------
> > 1 file changed, 21 insertions(+), 19 deletions(-)
> >
> > diff --git a/pyanaconda/storage/size.py b/pyanaconda/storage/size.py
> > index 757c97b..25247fc 100644
> > --- a/pyanaconda/storage/size.py
> > +++ b/pyanaconda/storage/size.py
> > @@ -208,27 +208,29 @@ class Size(Decimal):
> > if Decimal(check) < 1000:
> > return "%s B" % check
> >
> > - for factor, prefix, abbr in _prefixes:
> > + for item in _prefixes:
> > + factor, prefix, abbr = item
>
> Looks ok, except I'm wondering why you factored the tuple unpacking out
> of the for loop.
Because it looked to me like a bug. It of course works either way, but
using the substitute variable from the for-cycle outside of it was
something that alarmed my "good-programming-habits" senses. I can change
it if nobody else has the same problem as I have.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list