Use exceptions for error handling
[rarslave2.git] / PAR2Set / OldRAR.py
index b872ccf..b139570 100644 (file)
@@ -74,14 +74,5 @@ class OldRAR (PAR2Set.Base.Base):
                assert os.path.isfile (file)
                assert os.path.isdir (todir)
 
-               RAR_CMD = rsutil.common.config_get_value ('commands', 'unrar')
-
-               cmd = '%s \"%s\"' % (RAR_CMD, file)
-               ret = rsutil.common.run_command (cmd, todir)
-
-               # Check error code
-               if ret != 0:
-                       return -rsutil.common.EEXTRACT
-
-               return rsutil.common.SUCCESS
+               rsutil.common.run_command(['unrar', 'x', '-o+', file], todir)