summaryrefslogtreecommitdiffstats
path: root/src/pyfedpkg/__init__.py
diff options
context:
space:
mode:
authorJesse Keating <jkeating@redhat.com>2010-12-02 16:09:39 -0800
committerJesse Keating <jkeating@redhat.com>2010-12-02 16:09:39 -0800
commit176be081d140b5cd08b1f09b12387bfcb58d1e75 (patch)
treedb3b8a4e2e2f7f91af97e07d8ba6862992231fbf /src/pyfedpkg/__init__.py
parent75fb5c6cffd889cc1076b84abc64bd1c055768bc (diff)
downloadfedora-packager-176be081d140b5cd08b1f09b12387bfcb58d1e75.tar.gz
fedora-packager-176be081d140b5cd08b1f09b12387bfcb58d1e75.tar.xz
fedora-packager-176be081d140b5cd08b1f09b12387bfcb58d1e75.zip
Handle having no sources file (#656897)
Diffstat (limited to 'src/pyfedpkg/__init__.py')
-rw-r--r--src/pyfedpkg/__init__.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py
index 8f202b8..fe426c2 100644
--- a/src/pyfedpkg/__init__.py
+++ b/src/pyfedpkg/__init__.py
@@ -738,8 +738,11 @@ def sources(path, outdir=None):
if not spec:
raise FedpkgError('%s is not a valid repo' % path)
module = spec.split('.spec')[0]
- archives = open(os.path.join(path, 'sources'),
- 'r').readlines()
+ try:
+ archives = open(os.path.join(path, 'sources'),
+ 'r').readlines()
+ except IOError, e:
+ raise FedpkgError('%s is not a valid repo: %s' % (path, e))
# Default to putting the files where the module is
if not outdir:
outdir = path