Hi Bruno,

The pythonic way is

    mode is not None

rather than 

    mode != None

(the reason is None is an object)

Just in case,
Dima

On 24 February 2024 23:25:51 GMT, Bruno Haible <br...@clisp.org> wrote:
>Hi Collin,
>
>> > I.e. you meant to write
>> >   mode != None
>> > not
>> >   modules != None
>> > ?
>> 
>> The second fixes this typo. Thanks for noticing it.
>
>But there's another typo in the same line: The original code
>
>  case $mode,$gnu_make in
>    *test*,true)
>      echo "gnulib-tool: --gnu-make not supported when including tests"
>      func_exit 1;;
>  esac
>
>has the intent to match the $mode values
>  create-testdir
>  create-megatestdir
>  test
>  megatest
>But these do not contain the substring "tests".
>
>Also, please can we stick with the syntax 'foo', not "foo", for literal
>strings. Outside of gnulib, both syntaxes seem to be in use. But when I
>search where the literal string 'foo' occurs, I don't want to make 2
>searches (for 'foo' and for "foo"), nor a regex search (for ['"]foo['"]).
>Simple things should remain simple. A certain canonical way to denote
>literal strings is necessary for this. (Btw, JavaScript has the same
>problem.)
>
>
>2024-02-24  Bruno Haible  <br...@clisp.org>
>
>       gnulib-tool.py: Further fix last commit.
>       * gnulib-tool.py (main): Make the mode test match for 'create-testdir',
>       'create-megatestdir', 'test', 'megatest'.
>
>diff --git a/gnulib-tool.py b/gnulib-tool.py
>index e168e8fc91..1df790c496 100755
>--- a/gnulib-tool.py
>+++ b/gnulib-tool.py
>@@ -607,7 +607,7 @@ def main():
>     if cmdargs.pobase == None and cmdargs.podomain != None:
>         message = '%s: warning: --po-domain has no effect without a --po-base 
> option\n' % constants.APP['name']
>         sys.stderr.write(message)
>-    if  mode != None and "tests" in mode and gnu_make:
>+    if mode != None and 'test' in mode and gnu_make:
>         message = '%s: --gnu-make not supported when including tests\n' % 
> constants.APP['name']
>         sys.stderr.write(message)
>         sys.exit(1)
>
>
>
>

Reply via email to