diff options
author | Jesse Keating <jkeating@redhat.com> | 2010-12-02 16:09:39 -0800 |
---|---|---|
committer | Jesse Keating <jkeating@redhat.com> | 2010-12-02 16:09:39 -0800 |
commit | 176be081d140b5cd08b1f09b12387bfcb58d1e75 (patch) | |
tree | db3b8a4e2e2f7f91af97e07d8ba6862992231fbf /src | |
parent | 75fb5c6cffd889cc1076b84abc64bd1c055768bc (diff) | |
download | fedora-packager-176be081d140b5cd08b1f09b12387bfcb58d1e75.tar.gz fedora-packager-176be081d140b5cd08b1f09b12387bfcb58d1e75.tar.xz fedora-packager-176be081d140b5cd08b1f09b12387bfcb58d1e75.zip |
Handle having no sources file (#656897)
Diffstat (limited to 'src')
-rw-r--r-- | src/pyfedpkg/__init__.py | 7 |
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 |