diff options
| author | Samus CTO <cto@openerp.com> | 2014-12-23 12:46:46 +0100 |
|---|---|---|
| committer | Samus CTO <cto@openerp.com> | 2014-12-23 12:46:46 +0100 |
| commit | ebe42d083b553a51501ddcf629279181fddcd5d7 (patch) | |
| tree | 309d13cf08b53d32033ef7c81fa22719af21b3cd /openerp/cli/shell.py | |
| parent | 252757c548b652cf394dd401062e8dbd4a4114ca (diff) | |
[FIX] shell: now catch SIGINT and raise a regular KeyboardInterrupt
Diffstat (limited to 'openerp/cli/shell.py')
| -rw-r--r-- | openerp/cli/shell.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/openerp/cli/shell.py b/openerp/cli/shell.py index 81cbf3a0baf..6b251284e6d 100644 --- a/openerp/cli/shell.py +++ b/openerp/cli/shell.py @@ -22,6 +22,9 @@ import signal import openerp from . import Command +def raise_keyboard_interrupt(*a): + raise KeyboardInterrupt() + class Console(code.InteractiveConsole): def __init__(self, locals=None, filename="<console>"): code.InteractiveConsole.__init__(self, locals, filename) @@ -43,10 +46,9 @@ class Shell(Command): self.locals = { 'openerp': openerp } + signal.signal(signal.SIGINT, raise_keyboard_interrupt) def shell(self, dbname): - signal.signal(signal.SIGINT, signal.SIG_DFL) - # TODO: Fix ctrl-c that doesnt seem to generate KeyboardInterrupt with openerp.api.Environment.manage(): if dbname: registry = openerp.modules.registry.RegistryManager.get(dbname) |
