Skip to contentSkip to conversation

scripts: More Python fixes

PATCH In review Philippe Mathieu-Daudé 2 participants 6 messages May 12, 2020

lore
Share & tools
lore
#0 lore raw

v3 cover scripts: More Python fixes

Trivial Python3 fixes, again...

Since v2:
- Remove patch updating MAINTAINERS

Since v1:
- Added Alex Bennée A-b tags
- Addressed John Snow review comments
- Use /usr/bin/env
- Do not modify os.path (dropped last patch)

Philippe Mathieu-Daudé (2):
scripts/qemugdb: Remove shebang header
scripts/qmp: Use Python 3 interpreter

 scripts/qemugdb/__init__.py  | 3 +--
 scripts/qemugdb/aio.py       | 3 +--
 scripts/qemugdb/coroutine.py | 3 +--
 scripts/qemugdb/mtree.py     | 4 +---
 scripts/qemugdb/tcg.py       | 1 -
 scripts/qmp/qom-get          | 2 +-
 scripts/qmp/qom-list         | 2 +-
 scripts/qmp/qom-set          | 2 +-
 scripts/qmp/qom-tree         | 2 +-
 9 files changed, 8 insertions(+), 14 deletions(-)
Signature · 1 line
2.21.3
#1 lore raw

PATCH v3 1/2 scripts/qemugdb: Remove shebang header

These scripts are loaded as plugin by GDB (and they don't have any __main__ entry point). Remove the shebang header.

---
 scripts/qemugdb/__init__.py  | 3 +--
 scripts/qemugdb/aio.py       | 3 +--
 scripts/qemugdb/coroutine.py | 3 +--
 scripts/qemugdb/mtree.py     | 4 +---
 scripts/qemugdb/tcg.py       | 1 -
 5 files changed, 4 insertions(+), 10 deletions(-)
scripts/qemugdb/__init__.py +1 -2
index 969f552b26..da8ff612e5 100644
@@ -1,5 +1,4 @@
-#!/usr/bin/python
-
+#
 # GDB debugging support
 #
 # Copyright (c) 2015 Linaro Ltd
scripts/qemugdb/aio.py +1 -2
index 2ba00c4444..d7c1ba0c28 100644
@@ -1,5 +1,4 @@
-#!/usr/bin/python
-
+#
 # GDB debugging support: aio/iohandler debug
 #
 # Copyright (c) 2015 Red Hat, Inc.
scripts/qemugdb/coroutine.py +1 -2
index 41e079d0e2..db61389022 100644
@@ -1,5 +1,4 @@
-#!/usr/bin/python
-
+#
 # GDB debugging support
 #
 # Copyright 2012 Red Hat, Inc. and/or its affiliates
scripts/qemugdb/mtree.py +1 -3
index 3030a60d3f..8fe42c3c12 100644
@@ -1,5 +1,4 @@
-#!/usr/bin/python
-
+#
 # GDB debugging support
 #
 # Copyright 2012 Red Hat, Inc. and/or its affiliates
@@ -84,4 +83,3 @@ def print_item(self, ptr, offset = gdb.Value(0), level = 0):
         while not isnull(subregion):
             self.print_item(subregion, addr, level)
             subregion = subregion['subregions_link']['tqe_next']
-
scripts/qemugdb/tcg.py +0 -1
index 18880fc9a7..16c03c06a9 100644
@@ -1,4 +1,3 @@
-#!/usr/bin/python
 # -*- coding: utf-8 -*-
 #
 # GDB debugging support, TCG status
Signature · 1 line
2.21.3
#2 lore raw

Re: [PATCH v3 1/2] scripts/qemugdb: Remove shebang header

Am 12.05.2020 um 09:06 hat Philippe Mathieu-Daudé geschrieben:

Quoted 11 lines

These scripts are loaded as plugin by GDB (and they don't have any __main__ entry point). Remove the shebang header.

---
 scripts/qemugdb/__init__.py  | 3 +--
 scripts/qemugdb/aio.py       | 3 +--
 scripts/qemugdb/coroutine.py | 3 +--
 scripts/qemugdb/mtree.py     | 4 +---
 scripts/qemugdb/tcg.py       | 1 -

There is still a shebang line left in scripts/qemugdb/timers.py.

Kevin

#3 lore raw

Re: [PATCH v3 1/2] scripts/qemugdb: Remove shebang header

Quoted 13 lines · Kevin Wolf

Am 12.05.2020 um 09:06 hat Philippe Mathieu-Daudé geschrieben:

Quoted 11 lines

These scripts are loaded as plugin by GDB (and they don't have any __main__ entry point). Remove the shebang header.

---
  scripts/qemugdb/__init__.py  | 3 +--
  scripts/qemugdb/aio.py       | 3 +--
  scripts/qemugdb/coroutine.py | 3 +--
  scripts/qemugdb/mtree.py     | 4 +---
  scripts/qemugdb/tcg.py       | 1 -
Quoted 1 line

There is still a shebang line left in scripts/qemugdb/timers.py.

Oops, thanks for catching this.

Quoted 3 lines

Kevin

#4 lore raw

PATCH v3 2/2 scripts/qmp: Use Python 3 interpreter

In reply to Philippe Mathieu-Daudé
---
 scripts/qmp/qom-get  | 2 +-
 scripts/qmp/qom-list | 2 +-
 scripts/qmp/qom-set  | 2 +-
 scripts/qmp/qom-tree | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
scripts/qmp/qom-get +1 -1
index 007b4cd442..7c5ede91bb 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
 ##
 # QEMU Object Model test tools
 #
scripts/qmp/qom-list +1 -1
index 03bda3446b..bb68fd65d4 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
 ##
 # QEMU Object Model test tools
 #
scripts/qmp/qom-set +1 -1
index c37fe78b00..19881d85e9 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
 ##
 # QEMU Object Model test tools
 #
scripts/qmp/qom-tree +1 -1
index 1c8acf61e7..fa91147a03 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
 ##
 # QEMU Object Model test tools
 #
Signature · 1 line
2.21.3