Python exceptions 模块,SystemExit() 实例源码

我们从Python开源项目中,提取了以下5个代码示例,用于说明如何使用exceptions.SystemExit()

项目:bokken    作者:thestr4ng3r    | 项目源码 | 文件源码
def handle_with_processors(self):
        def process(processors):
            try:
                if processors:
                    p, processors = processors[0], processors[1:]
                    return p(lambda: process(processors))
                else:
                    return self.handle()
            except web.HTTPError:
                raise
            except (KeyboardInterrupt, SystemExit):
                raise
            except:
                print >> web.debug, traceback.format_exc()
                raise self.internalerror()

        # processors must be applied in the resvere order. (??)
        return process(self.processors)
项目:py-script    作者:xiaoxiamin    | 项目源码 | 文件源码
def handle_with_processors(self):
        def process(processors):
            try:
                if processors:
                    p, processors = processors[0], processors[1:]
                    return p(lambda: process(processors))
                else:
                    return self.handle()
            except web.HTTPError:
                raise
            except (KeyboardInterrupt, SystemExit):
                raise
            except:
                print >> web.debug, traceback.format_exc()
                raise self.internalerror()

        # processors must be applied in the resvere order. (??)
        return process(self.processors)
项目:py-script    作者:xiaoxiamin    | 项目源码 | 文件源码
def handle_with_processors(self):
        def process(processors):
            try:
                if processors:
                    p, processors = processors[0], processors[1:]
                    return p(lambda: process(processors))
                else:
                    return self.handle()
            except web.HTTPError:
                raise
            except (KeyboardInterrupt, SystemExit):
                raise
            except:
                print >> web.debug, traceback.format_exc()
                raise self.internalerror()

        # processors must be applied in the resvere order. (??)
        return process(self.processors)
项目:cosa-nostra    作者:joxeankoret    | 项目源码 | 文件源码
def handle_with_processors(self):
        def process(processors):
            try:
                if processors:
                    p, processors = processors[0], processors[1:]
                    return p(lambda: process(processors))
                else:
                    return self.handle()
            except web.HTTPError:
                raise
            except (KeyboardInterrupt, SystemExit):
                raise
            except:
                print >> web.debug, traceback.format_exc()
                raise self.internalerror()

        # processors must be applied in the resvere order. (??)
        return process(self.processors)
项目:ooniprobe-debian    作者:TheTorProject    | 项目源码 | 文件源码
def test_create_deck_not_found(self):
        global_options = {
            'no-yamloo': True,
            'subargs': [],
            'annotations': {},
            'collector': None,
            'bouncer': None,
            'no-collector': False,
            'test_file': 'invalid/path',
            'testdeck': None
        }
        exc = None
        try:
            createDeck(global_options)
        except exceptions.SystemExit as exc:
            exc = exc
        self.assertIsNotNone(exc)
        self.assertEqual(exc.code, 3)