mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-12 15:41:09 +00:00
Use the same construction as pull-debian-source
This commit is contained in:
parent
586197d591
commit
0adca3f7a1
@ -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']
|
||||
|
@ -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']
|
||||
|
Loading…
x
Reference in New Issue
Block a user