Commit 72d8fed2 authored by Julian Andres Klode's avatar Julian Andres Klode
Browse files

Merge branch 'exists-source.list' into 'master'

aptsources: Allow non-existent `source.list` file

See merge request apt-team/python-apt!45
parents 49e05ae2 fc67fb4c
......@@ -280,7 +280,8 @@ class SourcesList(object):
self.list = []
# read sources.list
file = apt_pkg.config.find_file("Dir::Etc::sourcelist")
self.load(file)
if os.path.exists(file):
self.load(file)
# read sources.list.d
partsdir = apt_pkg.config.find_dir("Dir::Etc::sourceparts")
for file in glob.glob("%s/*.list" % partsdir):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment