handle missing parser class
This commit is contained in:
parent
f889863eea
commit
40c8067dbf
1 changed files with 5 additions and 2 deletions
|
@ -68,8 +68,11 @@ class DependencyParser(object):
|
||||||
module_name = self.lexer.__module__.split('.')[-1]
|
module_name = self.lexer.__module__.split('.')[-1]
|
||||||
class_name = self.lexer.__class__.__name__.replace('Lexer', 'Parser', 1)
|
class_name = self.lexer.__class__.__name__.replace('Lexer', 'Parser', 1)
|
||||||
module = import_module('.%s' % module_name, package=__package__)
|
module = import_module('.%s' % module_name, package=__package__)
|
||||||
self.parser = getattr(module, class_name)
|
try:
|
||||||
except ImportError as ex:
|
self.parser = getattr(module, class_name)
|
||||||
|
except AttributeError:
|
||||||
|
log.debug(traceback.format_exc())
|
||||||
|
except ImportError:
|
||||||
log.debug(traceback.format_exc())
|
log.debug(traceback.format_exc())
|
||||||
|
|
||||||
def parse(self):
|
def parse(self):
|
||||||
|
|
Loading…
Reference in a new issue