Use our own User-Agent in urllib2 requests.

git-svn-id: svn+ssh://rpmlint.zarb.org/home/projects/rpmlint/svn/trunk@1713 9bc8b190-ac0f-0410-8968-dc7d1f502856
This commit is contained in:
Ville Skyttä 2010-01-21 21:59:33 +00:00
parent 65179dc1ba
commit bddeebcd94
1 changed files with 2 additions and 0 deletions

View File

@ -56,6 +56,8 @@ class AbstractCheck:
res = err = None
try:
opener = urllib2.build_opener(_HeadRedirectHandler())
opener.addheaders = [('User-Agent',
'rpmlint/%s' % Config.__version__)]
res = opener.open(_HeadRequest(url))
except Exception, e:
errstr = str(e) or repr(e) or type(e)