import re at the right places

This commit is contained in:
Stephan Kulow 2015-01-20 15:02:46 +01:00
parent f96cf7d4bb
commit f095600f9b
2 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,5 @@
import time import time
import re
from xml.etree import cElementTree as ET from xml.etree import cElementTree as ET

View File

@ -8,6 +8,7 @@ import json
import logging import logging
import urllib2 import urllib2
import time import time
import re
from xml.etree import cElementTree as ET from xml.etree import cElementTree as ET
import yaml import yaml
@ -924,7 +925,7 @@ class StagingAPI(object):
if specfile: if specfile:
try: try:
version = re.findall("^Version:(.*)",specfile,re.MULTILINE)[0].strip() version = re.findall("^Version:(.*)",specfile,re.MULTILINE)[0].strip()
except: except IndexError:
pass pass
return version return version
@ -938,7 +939,7 @@ class StagingAPI(object):
url = self.makeurl(['source', project, package, '{}?expand=1'.format(filename)]) url = self.makeurl(['source', project, package, '{}?expand=1'.format(filename)])
try: try:
return http_GET(url).read() return http_GET(url).read()
except: except urllib2.HTTPError:
return None return None
def save_file_content(self, project, package, filename, content): def save_file_content(self, project, package, filename, content):