[issue10506] argparse execute system exit in python prompt

Tarsis Azevedo report at bugs.python.org
Mon Nov 22 16:15:23 CET 2010


New submission from Tarsis Azevedo <tarsis.azevedo at gmail.com>:

Hi all, when I use argparse in python prompt, and raise a exception, as the code below:

    >>> import argparse
    >>> parser = argparse.ArgumentParser()
    >>> parser.add_argument('-i' type=int)
    >>> parser.parse_args(['-i', 'a'])

the prompt is closed.

This behavior this in error function (Lib/argparse.py:2325)
I think in python prompt this behavior it's wrong.

it's right?!

----------
components: Library (Lib)
messages: 122134
nosy: Tarsis.Azevedo
priority: normal
severity: normal
status: open
title: argparse execute system exit in python prompt
type: behavior
versions: Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10506>
_______________________________________


More information about the Python-bugs-list mailing list