summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFreeyorp <TheFreeYorp+git@gmail.com>2024-06-04 14:15:47 +0000
committerFreeyorp <TheFreeYorp+git@gmail.com>2024-06-04 14:15:47 +0000
commit53051b7cace8db3ec948349e0538e393e4af6860 (patch)
tree0b390a2248d446293b35f3d038fea91c08b83fbf
parent1841311e6302ff88e53446744e571bed703d2087 (diff)
downloadtmwa-53051b7cace8db3ec948349e0538e393e4af6860.tar.gz
tmwa-53051b7cace8db3ec948349e0538e393e4af6860.tar.bz2
tmwa-53051b7cace8db3ec948349e0538e393e4af6860.tar.xz
tmwa-53051b7cace8db3ec948349e0538e393e4af6860.zip
Very basic python3 support
Extremely minimal, not touching any __future__ imports or such. For serious use, see specing's WIP PR at: https://git.themanaworld.org/legacy/tmwa/-/merge_requests/256
-rw-r--r--.gitmodules2
-rwxr-xr-xconfigure2
m---------deps/attoconf0
-rwxr-xr-xtools/bs-align2
-rwxr-xr-xtools/colorize2
-rwxr-xr-xtools/config.py2
-rwxr-xr-xtools/debug-debug-scripts8
-rwxr-xr-xtools/indenter2
-rwxr-xr-xtools/pp-indent2
-rwxr-xr-xtools/protocol.py2
10 files changed, 15 insertions, 9 deletions
diff --git a/.gitmodules b/.gitmodules
index 8197e60..48c5d1f 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,6 +1,6 @@
[submodule "deps/attoconf"]
path = deps/attoconf
- url = https://github.com/o11c/attoconf.git
+ url = https://github.com/Freeyorp/attoconf
[submodule "deps/googletest"]
path = deps/googletest
url = https://github.com/google/googletest.git
diff --git a/configure b/configure
index aa1d0fd..275a9c4 100755
--- a/configure
+++ b/configure
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright 2013 Ben Longbons <b.r.longbons@gmail.com>
#
diff --git a/deps/attoconf b/deps/attoconf
-Subproject 7b939e7e4ce36e8b62b10025e567f871731cbf4
+Subproject f8844ed8f37189396a3c6589909a33673ce6bc7
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..849fb61 100755
--- a/tools/colorize
+++ b/tools/colorize
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import print_function
diff --git a/tools/config.py b/tools/config.py
index f87fe77..a2645d8 100755
--- a/tools/config.py
+++ b/tools/config.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# coding: utf-8
# config.py - generator for config file parsers
diff --git a/tools/debug-debug-scripts b/tools/debug-debug-scripts
index 2112a6e..cfdc31f 100755
--- a/tools/debug-debug-scripts
+++ b/tools/debug-debug-scripts
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# encoding: utf-8
from __future__ import print_function
@@ -35,6 +35,12 @@ error = False
def eprint(s):
print('Error:', s, file=sys.stderr)
+# Implement an equivalent to Python 2's execfile for Python 3
+def execfile(filename, globals=None, locals=None):
+ with open(filename, 'r') as f:
+ code = compile(f.read(), filename, 'exec')
+ exec(code, globals, locals)
+
def get_classes_from_file(a):
global error
d = {}
diff --git a/tools/indenter b/tools/indenter
index 0d93543..f7c1657 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
##
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
##
diff --git a/tools/protocol.py b/tools/protocol.py
index cf89a16..d63c22d 100755
--- a/tools/protocol.py
+++ b/tools/protocol.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# coding: utf-8
# protocol.py - generator for entire TMWA network protocol