handle common exceptions even during application loading
This commit is contained in:
parent
e1196bc30a
commit
2d4587c147
1 changed files with 2 additions and 2 deletions
|
|
@ -28,7 +28,7 @@ from weboob.tools.backend import ObjectNotAvailable
|
||||||
from weboob.tools.log import createColoredFormatter, getLogger
|
from weboob.tools.log import createColoredFormatter, getLogger
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['BackendNotFound', 'BaseApplication', 'ConfigError']
|
__all__ = ['BackendNotFound', 'BaseApplication']
|
||||||
|
|
||||||
|
|
||||||
class BackendNotFound(Exception):
|
class BackendNotFound(Exception):
|
||||||
|
|
@ -356,10 +356,10 @@ class BaseApplication(object):
|
||||||
if args is None:
|
if args is None:
|
||||||
args = [(sys.stdin.encoding and arg.decode(sys.stdin.encoding) or arg) for arg in sys.argv]
|
args = [(sys.stdin.encoding and arg.decode(sys.stdin.encoding) or arg) for arg in sys.argv]
|
||||||
app = klass()
|
app = klass()
|
||||||
args = app.parse_args(args)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
try:
|
try:
|
||||||
|
args = app.parse_args(args)
|
||||||
sys.exit(app.main(args))
|
sys.exit(app.main(args))
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print 'Program killed by SIGINT'
|
print 'Program killed by SIGINT'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue