[newui] [PATCH] Check that Gtk.main is not already running before starting another one

Chris Lumens clumens at redhat.com
Fri Aug 3 18:44:39 UTC 2012


> diff --git a/pyanaconda/exception.py b/pyanaconda/exception.py
> index 70deed5..00c1696 100644
> --- a/pyanaconda/exception.py
> +++ b/pyanaconda/exception.py
> @@ -131,6 +131,9 @@ class AnacondaExceptionHandler(ExceptionHandler):
>          except SystemError:
>              pass
>  
> +    def runQuit(self, *args):
> +        os.system("systemctl --no-wall reboot")
> +
>  def initExceptionHandling(anaconda):
>      fileList = [ "/tmp/anaconda.log",
>                   "/tmp/program.log", "/tmp/storage.log", "/tmp/ifcfg.log",

I think runQuit need to use the same kind of code we do elsewhere to
make sure anaconda's exitHandler function gets run.  I'd like to make
sure every way out of anaconda passes through that function.

> @@ -87,6 +88,13 @@ class GraphicalUserInterface(UserInterface):
>      def run(self):
>          from gi.repository import Gtk
>  
> +        if Gtk.main_level() > 0:
> +            # Gtk main loop running. That means python-meh caught exception
> +            # and runs its main loop. Do not crash Gtk by running another one
> +            # from a different thread and just wait for the reboot.
> +            while True:
> +                time.sleep(10000)
> +
>          from pyanaconda.product import isFinal, productName, productVersion
>  
>          # If we set these values on the very first window shown, they will get

Seems a bit ungraceful, but at least there's a helpful comment.  The
best alternative I can suggest is joining on a thread but you'd have to
figure out which one to join on first.

- Chris


More information about the anaconda-patches mailing list