Re: [f17 master] empty versions shouldn't be upgradable or traceback (#791317)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2012-02-16 at 15:50 -0800, Brian C. Lane wrote:
> From: "Brian C. Lane" <bcl@xxxxxxxxxx>
> 
> Also don't use float to compare 2 numbers. Use Decimal instead.

Ack.

> ---
>  pyanaconda/installclasses/fedora.py |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/pyanaconda/installclasses/fedora.py b/pyanaconda/installclasses/fedora.py
> index e96d525..e7b5c57 100644
> --- a/pyanaconda/installclasses/fedora.py
> +++ b/pyanaconda/installclasses/fedora.py
> @@ -33,6 +33,7 @@ from pyanaconda import installmethod
>  from pyanaconda import yuminstall
>  
>  import rpmUtils.arch
> +from decimal import Decimal
>  
>  class InstallClass(BaseInstallClass):
>      # name has underscore used for mnemonics, strip if you dont need it
> @@ -113,10 +114,13 @@ class InstallClass(BaseInstallClass):
>          return False
>  
>      def versionMatches(self, oldver):
> +        if oldver is None:
> +            return False
> +
>          try:
> -            oldVer = float(oldver)
> +            oldVer = Decimal(oldver)
>              # Trim off any "-Alpha" or "-Beta".
> -            newVer = float(productVersion.split('-')[0])
> +            newVer = Decimal(productVersion.split('-')[0])
>          except ValueError:
>              return True
>  


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux