summaryrefslogtreecommitdiff
path: root/obnamlib/encryption.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2011-07-25 17:02:47 +0100
committerLars Wirzenius <liw@liw.fi>2011-07-25 17:02:47 +0100
commit1c4629fdabe53ca2f3606cc3c1a71365738bc1d1 (patch)
treea412965e186078b8215107e710617797a28dc4d9 /obnamlib/encryption.py
parent32af7e5bad4bc06f97a670388151a886342c0309 (diff)
downloadobnam-1c4629fdabe53ca2f3606cc3c1a71365738bc1d1.tar.gz
Make all exceptions be based on obnamlib.AppException or obnamlib.Error.
Diffstat (limited to 'obnamlib/encryption.py')
-rw-r--r--obnamlib/encryption.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/obnamlib/encryption.py b/obnamlib/encryption.py
index d8fe836a..39b88470 100644
--- a/obnamlib/encryption.py
+++ b/obnamlib/encryption.py
@@ -19,6 +19,8 @@ import shutil
import subprocess
import tempfile
+import obnamlib
+
def generate_symmetric_key(numbits, filename='/dev/random'):
'''Generate a random key of at least numbits for symmetric encryption.'''
@@ -86,7 +88,7 @@ def _gpg_pipe(args, data, passphrase):
# Return output data, or deal with errors.
if p.returncode: # pragma: no cover
- raise Exception(err)
+ raise obnamlib.Error(err)
return out
@@ -116,7 +118,7 @@ def _gpg(args, stdin='', gpghome=None):
# Return output data, or deal with errors.
if p.returncode: # pragma: no cover
- raise Exception(err)
+ raise obnamlib.Error(err)
return out