tskip nonexistent when loading Packages files - amprolla - devuan's apt repo merger HTML git clone git://parazyd.org/amprolla.git DIR Log DIR Files DIR Refs DIR README DIR LICENSE --- DIR commit 61990d531cc3b64f61fcefae6da9bf5d7bb5321a DIR parent a0f2b7d8f0ac26130755a018c8e62fbae15f89e9 HTML Author: parazyd <parazyd@dyne.org> Date: Thu, 1 Jun 2017 14:30:57 +0200 skip nonexistent when loading Packages files Diffstat: M lib/package.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- DIR diff --git a/lib/package.py b/lib/package.py t@@ -46,7 +46,8 @@ def load_packages_file(filename): """ Load a gzip'd packages file. Returns a dictionary of package name and package key-values. """ - if filename is not None: + # TODO: should we skip files like this if they don't exist? + if filename is not None and os.path.isfile(filename): packages_contents = gzip_open(filename).read() packages_contents = packages_contents.decode('utf-8') return parse_packages(packages_contents)