Commits

Jakub Wilk  committed 0a9d5dc

Better error handling.

  • Participants
  • Parent commits dc368c8

Comments (0)

Files changed (1)

File password-manager

 
     '''
     gpg = ipc.Popen(['gpg', '-q', '-d'], stdout=ipc.PIPE)
-    for item in yaml.load(gpg.stdout):
+    lines = yaml.load(gpg.stdout)
+    for item in yaml.load(gpg.stdout) or []:
         site = str(item['site'])
         if not options.keyword in site:
             continue
         )
         if xclip is not None:
             if xclip.wait() != 0:
-                raise IOError('xclip')
-    gpg.wait()
+                raise IOError('xclip failed')
+    if gpg.wait() != 0:
+        raise IOError('gpg failed')
 
 def char_range(a, b):
     return [chr(n) for n in range(ord(a), ord(b))]