cleanup: minor fixes in comboparse and soup_parser
This commit is contained in:
@@ -35,8 +35,10 @@ class ComboParser(object):
|
||||
if self.loaded: return
|
||||
self.loaded = True
|
||||
|
||||
try: self.cparser.read(self.ini)
|
||||
except: pass
|
||||
try:
|
||||
self.cparser.read(self.ini)
|
||||
except Exception:
|
||||
pass # config file missing or unreadable, use defaults
|
||||
args = self.aparser.parse_args()
|
||||
for item in self.items:
|
||||
try:
|
||||
@@ -61,7 +63,8 @@ class ComboParser(object):
|
||||
if arg is not None:
|
||||
inner = arg
|
||||
item['found'] = True
|
||||
except: pass
|
||||
except AttributeError:
|
||||
pass # arg not provided on command line
|
||||
if not item['found']:
|
||||
if item['required']:
|
||||
sys.stderr.write('error: required config item "%s" not found in section "%s" of "%s"!\n'%(item['name'], item['section'], self.ini))
|
||||
|
||||
@@ -61,8 +61,8 @@ def _parse_stdlib(html):
|
||||
parser = LinkExtractor()
|
||||
try:
|
||||
parser.feed(html)
|
||||
except:
|
||||
pass
|
||||
except Exception:
|
||||
pass # malformed HTML, return partial results
|
||||
return SoupResult(parser.tags)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user