From 176be081d140b5cd08b1f09b12387bfcb58d1e75 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Thu, 2 Dec 2010 16:09:39 -0800 Subject: Handle having no sources file (#656897) --- src/pyfedpkg/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') 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 -- cgit