[PATCH] docs: trace: decode_msr.py: make it compatible with python 3

Mauro Carvalho Chehab posted 1 patch 10 months, 1 week ago
Documentation/trace/postprocess/decode_msr.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] docs: trace: decode_msr.py: make it compatible with python 3
Posted by Mauro Carvalho Chehab 10 months, 1 week ago
This script uses print <foo> instead of print(foo), which is
incompatible with Python 3.

Fix it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 Documentation/trace/postprocess/decode_msr.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/trace/postprocess/decode_msr.py b/Documentation/trace/postprocess/decode_msr.py
index aa9cc7abd5c2..f5609b16f589 100644
--- a/Documentation/trace/postprocess/decode_msr.py
+++ b/Documentation/trace/postprocess/decode_msr.py
@@ -32,6 +32,6 @@ for j in sys.stdin:
 					break
 		if r:
 			j = j.replace(" " + m.group(2), " " + r + "(" + m.group(2) + ")")
-	print j,
+	print(j)
 
 
-- 
2.48.1
Re: [PATCH] docs: trace: decode_msr.py: make it compatible with python 3
Posted by Jonathan Corbet 10 months ago
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> writes:

> This script uses print <foo> instead of print(foo), which is
> incompatible with Python 3.
>
> Fix it.
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> ---
>  Documentation/trace/postprocess/decode_msr.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/trace/postprocess/decode_msr.py b/Documentation/trace/postprocess/decode_msr.py
> index aa9cc7abd5c2..f5609b16f589 100644
> --- a/Documentation/trace/postprocess/decode_msr.py
> +++ b/Documentation/trace/postprocess/decode_msr.py
> @@ -32,6 +32,6 @@ for j in sys.stdin:
>  					break
>  		if r:
>  			j = j.replace(" " + m.group(2), " " + r + "(" + m.group(2) + ")")
> -	print j,
> +	print(j)

This does make me wonder when this script was last used ... it hasn't
seen a real change since it was added in 2015.  Oh well, it should at
least work with current Python ... applied, thanks.

jon
Re: [PATCH] docs: trace: decode_msr.py: make it compatible with python 3
Posted by Pavel Machek 9 months, 4 weeks ago
On Thu 2025-02-13 09:46:42, Jonathan Corbet wrote:
> Mauro Carvalho Chehab <mchehab+huawei@kernel.org> writes:
> 
> > This script uses print <foo> instead of print(foo), which is
> > incompatible with Python 3.
> >
> > Fix it.
> >
> > Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> > ---
> >  Documentation/trace/postprocess/decode_msr.py | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/Documentation/trace/postprocess/decode_msr.py b/Documentation/trace/postprocess/decode_msr.py
> > index aa9cc7abd5c2..f5609b16f589 100644
> > --- a/Documentation/trace/postprocess/decode_msr.py
> > +++ b/Documentation/trace/postprocess/decode_msr.py
> > @@ -32,6 +32,6 @@ for j in sys.stdin:
> >  					break
> >  		if r:
> >  			j = j.replace(" " + m.group(2), " " + r + "(" + m.group(2) + ")")
> > -	print j,
> > +	print(j)
> 
> This does make me wonder when this script was last used ... it hasn't
> seen a real change since it was added in 2015.  Oh well, it should at
> least work with current Python ... applied, thanks.

This conversion is wrong, AFACIT. Old code one avoids adding \n, new
adds it.

BR,
								Pavel

-- 
People of Russia, stop Putin before his war on Ukraine escalates.