summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFedja Beader <fedja@protonmail.ch>2023-12-14 01:16:43 +0100
committerFedja Beader <fedja@protonmail.ch>2024-01-28 17:25:09 +0100
commit401d1592096ad5f06be336bdf6e305f87c3b359b (patch)
tree718c75cbdf3f8c03a37f1ff5cd12263709e21eb8
parentf535bec6e5b01ce418bae0c19104947a809e9abf (diff)
downloadtmwa-401d1592096ad5f06be336bdf6e305f87c3b359b.tar.gz
tmwa-401d1592096ad5f06be336bdf6e305f87c3b359b.tar.bz2
tmwa-401d1592096ad5f06be336bdf6e305f87c3b359b.tar.xz
tmwa-401d1592096ad5f06be336bdf6e305f87c3b359b.zip
2to3 + explicit python3 on top
-rw-r--r--src/main-gdb-head.py1
-rwxr-xr-xtools/bs-align2
-rwxr-xr-xtools/colorize4
-rwxr-xr-xtools/indenter8
-rwxr-xr-xtools/pp-indent2
5 files changed, 9 insertions, 8 deletions
diff --git a/src/main-gdb-head.py b/src/main-gdb-head.py
index dc688d7..90d1396 100644
--- a/src/main-gdb-head.py
+++ b/src/main-gdb-head.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python3
# Work around awkwardness in gdb's python printers:
# 1. In src/main-gdb-head.py, define the printer mechanism.
# 2. In src/*/*.py, define all the printer classes.
diff --git a/tools/bs-align b/tools/bs-align
index 6582298..0caf649 100755
--- a/tools/bs-align
+++ b/tools/bs-align
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# -*- encoding: utf-8
## bs-align.py - Filter to align trailing line continuations
##
diff --git a/tools/colorize b/tools/colorize
index ce6f410..6bee58b 100755
--- a/tools/colorize
+++ b/tools/colorize
@@ -1,6 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+
-from __future__ import print_function
import os
import sys
diff --git a/tools/indenter b/tools/indenter
index 0d93543..cb27e71 100755
--- a/tools/indenter
+++ b/tools/indenter
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# -*- encoding: utf-8
## indenter.py - Top-level indenter for all files
##
@@ -20,10 +20,10 @@
## along with this program. If not, see <http://www.gnu.org/licenses/>.
-from __future__ import print_function
+
from collections import namedtuple
-import cStringIO
+import io
import string
import subprocess
import sys
@@ -114,7 +114,7 @@ class Reader(object):
self._column += 1
def string_reader(s, name='<string>', line=1, column=1):
- return Reader(name, cStringIO.StringIO(s), line, column)
+ return Reader(name, io.StringIO(s), line, column)
def take_while(b, r, s):
assert isinstance(b, bytearray)
diff --git a/tools/pp-indent b/tools/pp-indent
index 9be9a03..622614a 100755
--- a/tools/pp-indent
+++ b/tools/pp-indent
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# -*- encoding: utf-8
## pp-indent - Filter to apply indentation to preprocessor statements
##