[PATCH] Do not return None from Size.__str__ (#869405)

Brian C. Lane bcl at redhat.com
Tue Oct 30 15:35:08 UTC 2012


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.

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 482 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/anaconda-patches/attachments/20121030/96cce8a6/attachment.sig>


More information about the anaconda-patches mailing list