From: Jonathan Corbet <Corbet@lwn.net>
To: shijm <junming@nfschina.com>
Cc: linux-scsi@vger.kernel.org, shijm <junming@nfschina.com>
Subject: Re: [PATCH] Documentation: add exception capture function
Date: Thu, 19 Jan 2023 14:20:03 -0700 [thread overview]
Message-ID: <87zgae6x30.fsf@meer.lwn.net> (raw)
In-Reply-To: <20230115110535.5597-1-junming@nfschina.com>
shijm <junming@nfschina.com> writes:
> Add exception capture function
>
> Signed-off-by: shijm <junming@nfschina.com>
This says what you are doing but not why; nobody has felt the need to
mess with this script for a while; why do we need to change it now?
> Documentation/target/tcm_mod_builder.py | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/target/tcm_mod_builder.py b/Documentation/target/tcm_mod_builder.py
> index 54492aa813b9..5b28d50ed80f 100755
> --- a/Documentation/target/tcm_mod_builder.py
> +++ b/Documentation/target/tcm_mod_builder.py
> @@ -29,8 +29,9 @@ def tcm_mod_create_module_subdir(fabric_mod_dir_var):
> return 1
>
> print "Creating fabric_mod_dir: " + fabric_mod_dir_var
> - ret = os.mkdir(fabric_mod_dir_var)
> - if ret:
> + try:
> + ret = os.mkdir(fabric_mod_dir_var)
> + except:
> tcm_mod_err("Unable to mkdir " + fabric_mod_dir_var)
Bare "except" clauses are generally a bad idea in my exception; I assume
you want to catch IOError here?
Assuming that this script is still useful, we should consider moving it
to tools/.
Thanks,
jon
next prev parent reply other threads:[~2023-01-19 21:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-15 11:05 [PATCH] Documentation: add exception capture function shijm
2023-01-19 21:20 ` Jonathan Corbet [this message]
2023-01-19 21:59 ` Bart Van Assche
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=87zgae6x30.fsf@meer.lwn.net \
--to=corbet@lwn.net \
--cc=junming@nfschina.com \
--cc=linux-scsi@vger.kernel.org \
/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