From: Simon Marchi <simon.marchi@ericsson.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>, <gdb-patches@sourceware.org>
Subject: Re: [rfc patch+7.11] gdb-gdb.py: SyntaxError: Missing parentheses in call to 'print'
Date: Mon, 22 Feb 2016 16:12:00 -0000 [thread overview]
Message-ID: <56CB337B.3060606@ericsson.com> (raw)
In-Reply-To: <20160222155646.GA1869@host1.jankratochvil.net>
On 16-02-22 10:56 AM, Jan Kratochvil wrote:
> Hi,
>
> after build GDB
> --with-python=/usr/bin/python3
> and for example stripping ./gdb and running:
> ./gdb -data-directory data-directory/ -iex "add-auto-load-safe-path $PWD/gdb-gdb.gdb" -iex "add-auto-load-safe-path $PWD/gdb-gdb.py" ./gdb
> I get:
> Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
> File "/home/jkratoch/redhat/gdb-test-python3/gdb/gdb-gdb.py", line 91
> print "Warning: Cannot find enum type_flag_value type."
> ^
> SyntaxError: Missing parentheses in call to 'print'
> (top-gdb) q
>
> The fix would be obvious:
> s/print \(".*"\)/print (\1)
>
> But then I was curious I do not see the warning messsage anyway.
> So I tried to append \n to that string but I still do not see the warning.
> But I do not know why. This patch is probably right and it could be checked
> in as "obvious" but given the warning still is not seen who knows.
Are you sure that the execution really goes through that line? When I run
this with Python 3:
if 1 == 2:
print "Hello"
print("Goodbye")
I get:
File "test.py", line 2
print "Hello"
^
SyntaxError: Missing parentheses in call to 'print'
That means Python notices the error at parse time, not execution time. It could
very well be that you don't see the warning because that line is not actually
executed.
next prev parent reply other threads:[~2016-02-22 16:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-22 15:56 Jan Kratochvil
2016-02-22 16:12 ` Simon Marchi [this message]
2016-02-22 16:20 ` [commit] " Jan Kratochvil
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=56CB337B.3060606@ericsson.com \
--to=simon.marchi@ericsson.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@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