Explorar o código

refactor set_ec usage

- _export_tar: remove unneeded call to set_ec
  print_warning() already sets the exit code to EXIT_WARNING.

- msgpack version check: raise Error instead of calling set_ec
Thomas Waldmann hai 1 ano
pai
achega
add7a22581
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  1. 1 2
      src/borg/archiver.py

+ 1 - 2
src/borg/archiver.py

@@ -1065,7 +1065,6 @@ class Archiver:
                 tarinfo.type = tarfile.FIFOTYPE
             else:
                 self.print_warning('%s: unsupported file type %o for tar export', remove_surrogates(item.path), modebits)
-                set_ec(EXIT_WARNING)
                 return None, stream
             return tarinfo, stream
 
@@ -5195,7 +5194,7 @@ class Archiver:
             logger.error("You do not have a supported version of the msgpack python package installed. Terminating.")
             logger.error("This should never happen as specific, supported versions are required by our setup.py.")
             logger.error("Do not contact borgbackup support about this.")
-            return set_ec(EXIT_ERROR)
+            raise Error("unsupported msgpack version")
         if is_slow_msgpack():
             logger.warning(PURE_PYTHON_MSGPACK_WARNING)
         if args.debug_profile: