* [PATCH] scripts/gdb: fix python 3.8 SyntaxWarning
@ 2020-08-05 22:50 Nick Desaulniers
2020-08-05 23:04 ` Stephen Boyd
0 siblings, 1 reply; 2+ messages in thread
From: Nick Desaulniers @ 2020-08-05 22:50 UTC (permalink / raw)
To: Andrew Morton, Jan Kiszka, Kieran Bingham
Cc: Aymeric Agon-Rambosson, Stephen Boyd, linux-kernel, Nick Desaulniers
Fixes the observed warnings:
scripts/gdb/linux/rbtree.py:20: SyntaxWarning: "is" with a literal. Did
you mean "=="?
if node is 0:
scripts/gdb/linux/rbtree.py:36: SyntaxWarning: "is" with a literal. Did
you mean "=="?
if node is 0:
It looks like this is a new warning added in Python 3.8. I've only seen
this once after adding the add-auto-load-safe-path rule to my ~/.gdbinit
for a new tree.
Cc: Stephen Boyd <swboyd@chromium.org>
Fixes: commit 449ca0c95ea2 ("scripts/gdb: add rb tree iterating utilities")
Link: https://adamj.eu/tech/2020/01/21/why-does-python-3-8-syntaxwarning-for-is-literal/
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
---
scripts/gdb/linux/rbtree.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/gdb/linux/rbtree.py b/scripts/gdb/linux/rbtree.py
index c4b991607917..fe462855eefd 100644
--- a/scripts/gdb/linux/rbtree.py
+++ b/scripts/gdb/linux/rbtree.py
@@ -17,7 +17,7 @@ def rb_first(root):
raise gdb.GdbError("Must be struct rb_root not {}".format(root.type))
node = root['rb_node']
- if node is 0:
+ if node == 0:
return None
while node['rb_left']:
@@ -33,7 +33,7 @@ def rb_last(root):
raise gdb.GdbError("Must be struct rb_root not {}".format(root.type))
node = root['rb_node']
- if node is 0:
+ if node == 0:
return None
while node['rb_right']:
--
2.28.0.163.g6104cc2f0b6-goog
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] scripts/gdb: fix python 3.8 SyntaxWarning
2020-08-05 22:50 [PATCH] scripts/gdb: fix python 3.8 SyntaxWarning Nick Desaulniers
@ 2020-08-05 23:04 ` Stephen Boyd
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2020-08-05 23:04 UTC (permalink / raw)
To: Andrew Morton, Jan Kiszka, Kieran Bingham, Nick Desaulniers
Cc: Aymeric Agon-Rambosson, linux-kernel, Nick Desaulniers
Quoting Nick Desaulniers (2020-08-05 15:50:14)
> Fixes the observed warnings:
> scripts/gdb/linux/rbtree.py:20: SyntaxWarning: "is" with a literal. Did
> you mean "=="?
> if node is 0:
> scripts/gdb/linux/rbtree.py:36: SyntaxWarning: "is" with a literal. Did
> you mean "=="?
> if node is 0:
>
> It looks like this is a new warning added in Python 3.8. I've only seen
> this once after adding the add-auto-load-safe-path rule to my ~/.gdbinit
> for a new tree.
>
> Cc: Stephen Boyd <swboyd@chromium.org>
> Fixes: commit 449ca0c95ea2 ("scripts/gdb: add rb tree iterating utilities")
> Link: https://adamj.eu/tech/2020/01/21/why-does-python-3-8-syntaxwarning-for-is-literal/
> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
> ---
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-08-05 23:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-05 22:50 [PATCH] scripts/gdb: fix python 3.8 SyntaxWarning Nick Desaulniers
2020-08-05 23:04 ` Stephen Boyd
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®