From 977865b5aaf9a7a4513e0e22a23ae114d4c58e87 Mon Sep 17 00:00:00 2001 From: Eric Torres Date: Wed, 10 Apr 2019 18:17:52 -0700 Subject: [PATCH] Remove type and value checking for PackageManager --- rbackup/package_managers/packagemanager.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/rbackup/package_managers/packagemanager.py b/rbackup/package_managers/packagemanager.py index 41fdb32..3dd60e9 100644 --- a/rbackup/package_managers/packagemanager.py +++ b/rbackup/package_managers/packagemanager.py @@ -7,7 +7,6 @@ import logging import subprocess import tarfile -from collections.abc import Iterable from pathlib import Path from tempfile import NamedTemporaryFile @@ -33,15 +32,6 @@ class PackageManager: :raises: ValueError if pkglist_cmd is an empty str or an iterable containing an empty str """ - if not isinstance(pkglist_cmd, Iterable) or isinstance(pkglist_cmd, dict): - raise TypeError("pkglist_cmd is the wrong type") - elif not pkglist_cmd: - raise ValueError(f"Package list command is empty: {pkglist_cmd}") - elif any(not isinstance(arg, str) for arg in pkglist_cmd): - raise TypeError(f"{pkglist_cmd} contains a non-str value") - elif any(not bool(arg) for arg in pkglist_cmd): - raise ValueError(f"{pkglist_cmd} contains an empty str value") - self._cachedir = Path(cachedir) self._db_path = Path(db_path) self._pkglist_cmd = pkglist_cmd