Re: [PATCH] Do not show "missing media" message when unknown media is needed for package.

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

 



> diff --git a/image.py b/image.py
> index 4376f84..447ef28 100644
> --- a/image.py
> +++ b/image.py
> @@ -47,6 +47,12 @@ else:
>  def presentRequiredMediaMessage(anaconda):
>      reqcds = anaconda.backend.ayum.tsInfo.reqmedia.keys()
>  
> +    # -99 means unknown media, ignore it if present
> +    try:
> +        reqcds.remove(-99)
> +    except ValueError:
> +        pass # ignore, we are happy to know nothing about -99 here
> +
>      # if only one CD required no need to pop up a message
>      if len(reqcds) < 2:
>  	return

The idea looks fine.  From a style perspective, I prefer:

   if -99 in reqcds:
      reqcds.remove(-99)

I was always taught that exceptions were for exceptional cases, not just
to get around error checking.

- Chris

_______________________________________________
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