| 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(-)
--- |
| 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) |