Patchwork [bitbake-devel] bitbake-diffsigs: Fix runtime error when no arguments are given

login
register
mail settings
Submitter Jacob Kroon
Date April 26, 2014, 3:05 p.m.
Message ID <1398524730-16722-1-git-send-email-jacob.kroon@mikrodidakt.se>
Download mbox | patch
Permalink /patch/71023/
State New
Headers show

Comments

Jacob Kroon - April 26, 2014, 3:05 p.m.
If bitbake-diffsigs is run without arguments it will error:

    Traceback (most recent call last):
      File "./bin/bitbake-diffsigs", line 121, in <module>
        if output:
    NameError: name 'output' is not defined

Fix this by moving the check for output into the inner else-clause.

Signed-off-by: Jacob Kroon <jacob.kroon@mikrodidakt.se>
---
 bin/bitbake-diffsigs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/bin/bitbake-diffsigs b/bin/bitbake-diffsigs
index 78757b0..08ae00d 100755
--- a/bin/bitbake-diffsigs
+++ b/bin/bitbake-diffsigs
@@ -118,5 +118,5 @@  else:
             logger.error('Invalid signature data - ensure you are specifying sigdata/siginfo files')
             sys.exit(1)
 
-    if output:
-        print '\n'.join(output)
+        if output:
+            print '\n'.join(output)