Fix an UnboundLocalError when there's no tty.
authorZac Medico <zmedico@gentoo.org>
Sun, 27 May 2007 12:48:22 +0000 (12:48 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 27 May 2007 12:48:22 +0000 (12:48 -0000)
svn path=/main/trunk/; revision=6641

bin/emaint

index 0628db3715dd69d67aae835c3773630608045250..e07f5a458c3843f6b09fbfe64d1d5c0a5c8c66d9 100755 (executable)
@@ -217,6 +217,7 @@ def emaint_main(myargv):
                if isatty:
                        progressBar = portage.output.TermProgressBar()
                        progressHandler = ProgressHandler()
+                       onProgress = progressHandler.progressHandler
                        def display():
                                progressBar.set(progressHandler.curval, progressHandler.maxval)
                        progressHandler.display = display
@@ -224,7 +225,7 @@ def emaint_main(myargv):
                                lines, progressBar.term_columns = \
                                        portage.output.get_term_size()
                        signal.signal(signal.SIGWINCH, sigwinch_handler)
-               result = getattr(inst, func)(onProgress=progressHandler.onProgress)
+               result = getattr(inst, func)(onProgress=onProgress)
                if isatty:
                        # make sure the final progress is displayed
                        progressHandler.display()