From: Tom Tromey <tromey@adacore.com>
To: Lancelot SIX <lsix@lancelotsix.com>
Cc: Tom Tromey <tromey@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH v2 3/3] Add a way to temporarily set a gdb parameter from Python
Date: Thu, 13 Jan 2022 12:46:00 -0700 [thread overview]
Message-ID: <87r19bju6f.fsf@tromey.com> (raw)
In-Reply-To: <20220113085059.z3rm44jun2sconai@Plymouth> (Lancelot SIX's message of "Thu, 13 Jan 2022 08:50:59 +0000")
Lancelot> try:
Lancelot> yield
Lancelot> finally:
Lancelot> set_parameter(name, old_value)
Lancelot> This way, the parameter is restored even in case of exception, which is
Lancelot> what I would expect from a python user point of view.
Yeah, thanks. I had assumed @contextmanager would handle this.
Anyway I'll make this change.
Tom
next prev parent reply other threads:[~2022-01-13 19:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-10 21:51 [PATCH v2 0/3] Improvements to Python parameters Tom Tromey
2022-01-10 21:51 ` [PATCH v2 1/3] Change how Python architecture and language are handled Tom Tromey
2022-01-31 13:20 ` Simon Marchi
2022-01-10 21:51 ` [PATCH v2 2/3] Fix another crash with gdb parameters in Python Tom Tromey
2022-01-10 21:51 ` [PATCH v2 3/3] Add a way to temporarily set a gdb parameter from Python Tom Tromey
2022-01-13 8:50 ` Lancelot SIX
2022-01-13 19:46 ` Tom Tromey [this message]
2022-01-26 14:06 ` [PATCH v2 0/3] Improvements to Python parameters 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=87r19bju6f.fsf@tromey.com \
--to=tromey@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=lsix@lancelotsix.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).