diff --git a/pull-debian-source b/pull-debian-source index 36a9caf..92077a1 100755 --- a/pull-debian-source +++ b/pull-debian-source @@ -58,16 +58,15 @@ def source_package_for(binary, release): Logger.warn(e) url = ('http://dde.debian.net/dde/q/udd/dist/d:debian/r:%s/p:%s/?t=json' % (release, binary)) + data = None try: data = json.load(urllib2.urlopen(url))['r'] except urllib2.URLError, e: Logger.error('Unable to retrieve package information from DDE: ' '%s (%s)', url, str(e)) - return None except ValueError, e: Logger.error('Unable to parse JSON response from DDE: ' '%s (%s)', url, str(e)) - return None if not data: return None return data[0]['source'] diff --git a/pull-lp-source b/pull-lp-source index 392abf1..0bbabbd 100755 --- a/pull-lp-source +++ b/pull-lp-source @@ -53,8 +53,9 @@ def source_package_for(binary, release): except urllib2.URLError, e: Logger.error('Unable to retrieve package information from DDE: ' '%s (%s)', url, str(e)) - except ValueError: - Logger.error('Unable to parse the response from DDE.') + except ValueError, e: + Logger.error('Unable to parse JSON response from DDE: ' + '%s (%s)', url, str(e)) if not data: return None return data[0]['source']