diff options
author | Collin Winter <collinw@gmail.com> | 2007-08-03 17:06:41 (GMT) |
---|---|---|
committer | Collin Winter <collinw@gmail.com> | 2007-08-03 17:06:41 (GMT) |
commit | 6afaeb757af0dbd8508a0f2352ade61e41bec84c (patch) | |
tree | f1b31bc7138b17ff39791bbb45aa81583c3b6e46 /Tools/bgen | |
parent | e5d0e8431f929cad2da77b63fe1b7dc0ff21a428 (diff) | |
download | cpython-6afaeb757af0dbd8508a0f2352ade61e41bec84c.zip cpython-6afaeb757af0dbd8508a0f2352ade61e41bec84c.tar.gz cpython-6afaeb757af0dbd8508a0f2352ade61e41bec84c.tar.bz2 |
Convert print statements to function calls in Tools/.
Diffstat (limited to 'Tools/bgen')
-rw-r--r-- | Tools/bgen/bgen/bgenGenerator.py | 8 | ||||
-rw-r--r-- | Tools/bgen/bgen/bgenGeneratorGroup.py | 4 | ||||
-rw-r--r-- | Tools/bgen/bgen/scantools.py | 46 |
3 files changed, 29 insertions, 29 deletions
diff --git a/Tools/bgen/bgen/bgenGenerator.py b/Tools/bgen/bgen/bgenGenerator.py index 3da3958..ae5c06b 100644 --- a/Tools/bgen/bgen/bgenGenerator.py +++ b/Tools/bgen/bgen/bgenGenerator.py @@ -16,7 +16,7 @@ INOUT = IN_OUT = "in-out" class BaseFunctionGenerator: def __init__(self, name, condition=None, callname=None, modifiers=None): - if DEBUG: print "<--", name + if DEBUG: print("<--", name) self.name = name if callname: self.callname = callname @@ -36,7 +36,7 @@ class BaseFunctionGenerator: def generate(self): if not self.checkgenerate(): return - if DEBUG: print "-->", self.name + if DEBUG: print("-->", self.name) if self.condition: Output() Output(self.condition) @@ -157,7 +157,7 @@ class FunctionGenerator(BaseFunctionGenerator): continue else: typeName = "?" - print "Nameless type", arg.type + print("Nameless type", arg.type) str = typeName + ' ' + arg.name if arg.mode in (InMode, InOutMode): @@ -294,7 +294,7 @@ def _test(): (int, 'status', ErrorMode), ) eggs.setprefix("spam") - print "/* START */" + print("/* START */") eggs.generate() diff --git a/Tools/bgen/bgen/bgenGeneratorGroup.py b/Tools/bgen/bgen/bgenGeneratorGroup.py index d82ab53..fd0a2c2 100644 --- a/Tools/bgen/bgen/bgenGeneratorGroup.py +++ b/Tools/bgen/bgen/bgenGeneratorGroup.py @@ -9,7 +9,7 @@ class GeneratorGroup: def add(self, g, dupcheck=0): if dupcheck: if g in self.generators: - print 'DUP', g.name + print('DUP', g.name) return g.setprefix(self.prefix) self.generators.append(g) @@ -33,7 +33,7 @@ def _test(): group = GeneratorGroup("spam") eggs = FunctionGenerator(void, "eggs") group.add(eggs) - print "/* START */" + print("/* START */") group.generate() if __name__ == "__main__": diff --git a/Tools/bgen/bgen/scantools.py b/Tools/bgen/bgen/scantools.py index bae29a0..3d973d0 100644 --- a/Tools/bgen/bgen/scantools.py +++ b/Tools/bgen/bgen/scantools.py @@ -162,11 +162,11 @@ if missing: raise "Missing Types" def error(self, format, *args): if self.silent >= 0: - print format%args + print(format%args) def report(self, format, *args): if not self.silent: - print format%args + print(format%args) def writeinitialdefs(self): pass @@ -221,7 +221,7 @@ if missing: raise "Missing Types" """ f = self.openrepairfile() if not f: return [] - print "Reading repair file", repr(f.name), "..." + print("Reading repair file", repr(f.name), "...") list = [] lineno = 0 while 1: @@ -237,31 +237,31 @@ if missing: raise "Missing Types" words = [s.strip() for s in line.split(':')] if words == ['']: continue if len(words) <> 3: - print "Line", startlineno, - print ": bad line (not 3 colon-separated fields)" - print repr(line) + print("Line", startlineno, end=' ') + print(": bad line (not 3 colon-separated fields)") + print(repr(line)) continue [fpat, pat, rep] = words if not fpat: fpat = "*" if not pat: - print "Line", startlineno, - print "Empty pattern" - print repr(line) + print("Line", startlineno, end=' ') + print("Empty pattern") + print(repr(line)) continue patparts = [s.strip() for s in pat.split(',')] repparts = [s.strip() for s in rep.split(',')] patterns = [] for p in patparts: if not p: - print "Line", startlineno, - print "Empty pattern part" - print repr(line) + print("Line", startlineno, end=' ') + print("Empty pattern part") + print(repr(line)) continue pattern = p.split() if len(pattern) > 3: - print "Line", startlineno, - print "Pattern part has > 3 words" - print repr(line) + print("Line", startlineno, end=' ') + print("Pattern part has > 3 words") + print(repr(line)) pattern = pattern[:3] else: while len(pattern) < 3: @@ -270,15 +270,15 @@ if missing: raise "Missing Types" replacements = [] for p in repparts: if not p: - print "Line", startlineno, - print "Empty replacement part" - print repr(line) + print("Line", startlineno, end=' ') + print("Empty replacement part") + print(repr(line)) continue replacement = p.split() if len(replacement) > 3: - print "Line", startlineno, - print "Pattern part has > 3 words" - print repr(line) + print("Line", startlineno, end=' ') + print("Pattern part has > 3 words") + print(repr(line)) replacement = replacement[:3] else: while len(replacement) < 3: @@ -294,8 +294,8 @@ if missing: raise "Missing Types" try: return open(filename, "rU") except IOError as msg: - print repr(filename), ":", msg - print "Cannot open repair file -- assume no repair needed" + print(repr(filename), ":", msg) + print("Cannot open repair file -- assume no repair needed") return None def initfiles(self): |