summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2008-09-24 00:25:47 +0000
committerowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2008-09-24 00:25:47 +0000
commit7edbfd9ff7f0a8f667e5c4bfd590911d286b7d46 (patch)
tree8f45cd5ea9154f3de57cf636a19044babd215bec
parente91387a44c73c9a8bfdbb8f150e51f29c0951f66 (diff)
downloadrdiff-backup-7edbfd9ff7f0a8f667e5c4bfd590911d286b7d46.tar.gz
Improve support for Python 2.5, which refactored the built-in exceptions so
that SystemExit and KeyboardInterrupt no longer derive from Exception. git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@936 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
-rw-r--r--rdiff-backup/CHANGELOG4
-rw-r--r--rdiff-backup/rdiff_backup/connection.py2
-rw-r--r--rdiff-backup/rdiff_backup/robust.py2
3 files changed, 7 insertions, 1 deletions
diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG
index abb77a6..74d75a7 100644
--- a/rdiff-backup/CHANGELOG
+++ b/rdiff-backup/CHANGELOG
@@ -1,6 +1,10 @@
New in v1.2.2 (????/??/??)
---------------------------
+Improve support for Python 2.5, which refactored the built-in exceptions so
+that SystemExit and KeyboardInterrupt no longer derive from Exception.
+Closes support request #106504. (Andrew Ferguson)
+
Adjust --exclude-if-present option to support directories, symlinks, device
files, etc. Closes bug #24192. Thanks to Vadim Zeitlin for the suggestion.
diff --git a/rdiff-backup/rdiff_backup/connection.py b/rdiff-backup/rdiff_backup/connection.py
index 34aebae..2fbe8ea 100644
--- a/rdiff-backup/rdiff_backup/connection.py
+++ b/rdiff-backup/rdiff_backup/connection.py
@@ -368,6 +368,8 @@ class PipeConnection(LowLevelPipeConnection):
result = self.get_response(req_num)
self.unused_request_numbers[req_num] = None
if isinstance(result, Exception): raise result
+ elif isinstance(result, SystemExit): raise result
+ elif isinstance(result, KeyboardInterrupt): raise result
else: return result
def get_new_req_num(self):
diff --git a/rdiff-backup/rdiff_backup/robust.py b/rdiff-backup/rdiff_backup/robust.py
index d339c24..1036801 100644
--- a/rdiff-backup/rdiff_backup/robust.py
+++ b/rdiff-backup/rdiff_backup/robust.py
@@ -30,7 +30,7 @@ def check_common_error(error_handler, function, args = []):
"""
try: return function(*args)
- except Exception, exc:
+ except (Exception, KeyboardInterrupt, SystemExit), exc:
TracebackArchive.add([function] + list(args))
if catch_error(exc):
log.Log.exception()