summaryrefslogtreecommitdiff
path: root/tools/preprocessor.py
diff options
context:
space:
mode:
authorWu Xiaotian <[email protected]>2020-06-22 00:01:07 +0000
committermbkma <[email protected]>2023-01-05 19:22:19 +0100
commitb724befdb6e61f97b44d04b9d55bc690aee5069f (patch)
tree6320fde2efb89bdd442119c6a0f44c691e1244b5 /tools/preprocessor.py
parentf628a6ef38b7c42febf8fbc450d46ab1f5461f6f (diff)
downloadpluma-b724befdb6e61f97b44d04b9d55bc690aee5069f.tar.bz2
pluma-b724befdb6e61f97b44d04b9d55bc690aee5069f.tar.xz
tools: update to use python3
Diffstat (limited to 'tools/preprocessor.py')
-rw-r--r--tools/preprocessor.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/preprocessor.py b/tools/preprocessor.py
index f78647bf..4292af02 100644
--- a/tools/preprocessor.py
+++ b/tools/preprocessor.py
@@ -23,6 +23,7 @@
import sys
import re
+import io
class DeepnessException(Exception):
def __init__(self):
@@ -64,13 +65,13 @@ def _subvar(match, macros):
return val
def process(infile = sys.stdin, outfile = sys.stdout, macros = {}):
- if not isinstance(infile, file):
+ if not isinstance(infile, io.IOBase):
infile = open(infile, mode = 'r')
close_infile = True
else:
close_infile = False
- if not isinstance(outfile, file):
+ if not isinstance(outfile, io.IOBase):
outfile = open(outfile, mode = 'w')
close_outfile = True
else: