From: <Paul_Koning@Dell.com>
To: <tromey@redhat.com>
Cc: <sanimir.agovic@intel.com>, <gdb-patches@sourceware.org>,
<pmuldoon@redhat.com>
Subject: Re: [PATCH 2/2] test: ensure certain types exposed to python are not instancable
Date: Thu, 10 Oct 2013 19:59:00 -0000 [thread overview]
Message-ID: <C75A84166056C94F84D238A44AF9F6AD03710AFD@AUSX10MPC103.AMER.DELL.COM> (raw)
In-Reply-To: <87txgp5473.fsf@fleche.redhat.com>
That syntax was added in Python 2.6. If you want to handle older Pythons, you need to use plain "except $exception" and extract the value ("e") via "e = sys.exc_info ()[1]". That workaround shows up in a number of other spots in the testsuite.
paul
On Oct 10, 2013, at 3:14 PM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Sanimir" == Sanimir Agovic <sanimir.agovic@intel.com> writes:
>
> Sanimir> The proc gdb_py_test_exception executes a piece of python code and
> Sanimir> expects an exception of type EXCEPTION to be raised by the code with
> Sanimir> an optional MESSAGE for fine grained filtering.
>
> FWIW I generally put the test cases in the same patch as the
> modification; same with the docs. That's because they are a conceptual
> unit.
>
> It looks good, however --
>
> Sanimir> + gdb_py_test_multiple "$stmt throws $exception" \
> Sanimir> + "python" "" \
> Sanimir> + "try:" "" \
> Sanimir> + " $stmt" "" \
> Sanimir> + "except $exception as e:" "" \
>
> ... there's one version of Python we support that doesn't have this
> syntax. I forget which one, I know Phil remembers though.
>
> Tom
next prev parent reply other threads:[~2013-10-10 19:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-30 14:40 [PATCH 0/2] prevent gdb.Frame/Objfile and other types to be instanciated Sanimir Agovic
2013-08-30 14:40 ` [PATCH 2/2] test: ensure certain types exposed to python are not instancable Sanimir Agovic
2013-10-10 19:14 ` Tom Tromey
2013-10-10 19:59 ` Paul_Koning [this message]
2013-08-30 14:40 ` [PATCH 1/2] python: disallow python code to instanciate certain types Sanimir Agovic
2013-08-30 15:08 ` Phil Muldoon
2013-10-10 19:08 ` Tom Tromey
2013-10-10 19:06 ` Tom Tromey
2013-10-10 19:10 ` [PATCH 0/2] prevent gdb.Frame/Objfile and other types to be instanciated Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=C75A84166056C94F84D238A44AF9F6AD03710AFD@AUSX10MPC103.AMER.DELL.COM \
--to=paul_koning@dell.com \
--cc=gdb-patches@sourceware.org \
--cc=pmuldoon@redhat.com \
--cc=sanimir.agovic@intel.com \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox