From d000f75c4542bbf0f39f78cf04713abf3ce4ab60 Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Mon, 16 Oct 2017 14:02:13 +0200 Subject: [PATCH] Handle exceptions when global_config is not yet set in fedabipkgdiff Handling an exception in fedabipkgdiff requires that the global_config object is set because we reference some if its data members. This patch avoids requiring the global_config object so that users can still be aware of the reason of the exception when that object is not yet set. * tools/fedabipkgdiff: When handling an exception, if the global_config object is not yet set then just let the exception through. Signed-off-by: Dodji Seketeli --- tools/fedabipkgdiff | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/fedabipkgdiff b/tools/fedabipkgdiff index fd66854e..b8c04f1c 100755 --- a/tools/fedabipkgdiff +++ b/tools/fedabipkgdiff @@ -1490,6 +1490,8 @@ if __name__ == '__main__': try: sys.exit(main()) except KeyboardInterrupt: + if global_config is None: + raise if global_config.debug: logger.debug('Terminate by user') else: @@ -1499,6 +1501,8 @@ if __name__ == '__main__': else: sys.exit(2) except Exception as e: + if global_config is None: + raise if global_config.debug: logger.debug(str(e)) else: