prevent traceback when kwalletcli is not available. see #5153

This commit is contained in:
Yann Leboulanger 2009-07-16 12:27:53 +02:00
parent cfc0c2fe5c
commit cc154c2bf2
1 changed files with 4 additions and 1 deletions

View File

@ -26,7 +26,10 @@ import subprocess
def kwallet_available():
"""Return True if kwalletcli can be run, False otherwise."""
p = subprocess.Popen(["kwalletcli", "-qV"])
try:
p = subprocess.Popen(["kwalletcli", "-qV"])
except Exception:
return False
p.communicate()
if p.returncode == 0:
return True