summaryrefslogtreecommitdiffstats
path: root/Tools/framer
diff options
context:
space:
mode:
authorCollin Winter <collinw@gmail.com>2007-08-03 17:06:41 (GMT)
committerCollin Winter <collinw@gmail.com>2007-08-03 17:06:41 (GMT)
commit6afaeb757af0dbd8508a0f2352ade61e41bec84c (patch)
treef1b31bc7138b17ff39791bbb45aa81583c3b6e46 /Tools/framer
parente5d0e8431f929cad2da77b63fe1b7dc0ff21a428 (diff)
downloadcpython-6afaeb757af0dbd8508a0f2352ade61e41bec84c.zip
cpython-6afaeb757af0dbd8508a0f2352ade61e41bec84c.tar.gz
cpython-6afaeb757af0dbd8508a0f2352ade61e41bec84c.tar.bz2
Convert print statements to function calls in Tools/.
Diffstat (limited to 'Tools/framer')
-rw-r--r--Tools/framer/framer/bases.py18
-rw-r--r--Tools/framer/framer/function.py4
-rw-r--r--Tools/framer/framer/member.py4
3 files changed, 13 insertions, 13 deletions
diff --git a/Tools/framer/framer/bases.py b/Tools/framer/framer/bases.py
index fb3cb03..99d47d1 100644
--- a/Tools/framer/framer/bases.py
+++ b/Tools/framer/framer/bases.py
@@ -27,7 +27,7 @@ class BaseMetaclass(type):
def dump_methoddef(self, f, functions, vars):
def p(templ, vars=vars): # helper function to generate output
- print >> f, templ % vars
+ print(templ % vars, file=f)
if not functions:
return
@@ -77,12 +77,12 @@ class ModuleMetaclass(BaseMetaclass):
def dump(self, f):
def p(templ, vars=self.__vars): # helper function to generate output
- print >> f, templ % vars
+ print(templ % vars, file=f)
p(template.module_start)
if self.__members:
p(template.member_include)
- print >> f
+ print(file=f)
if self.__doc__:
p(template.module_doc)
@@ -111,10 +111,10 @@ class TypeMetaclass(BaseMetaclass):
# defined after initvars() so that __vars is defined
def p(templ, vars=self.__vars):
- print >> f, templ % vars
+ print(templ % vars, file=f)
if self.struct is not None:
- print >> f, unindent(self.struct, False)
+ print(unindent(self.struct, False), file=f)
if self.__doc__:
p(template.docstring)
@@ -185,7 +185,7 @@ class TypeMetaclass(BaseMetaclass):
def dump_memberdef(self, f):
def p(templ, vars=self.__vars):
- print >> f, templ % vars
+ print(templ % vars, file=f)
if not self.__members:
return
@@ -196,7 +196,7 @@ class TypeMetaclass(BaseMetaclass):
def dump_slots(self, f):
def p(templ, vars=self.__vars):
- print >> f, templ % vars
+ print(templ % vars, file=f)
if self.struct:
p(template.dealloc_func, {"name" : self.__slots[TP_DEALLOC]})
@@ -206,12 +206,12 @@ class TypeMetaclass(BaseMetaclass):
val = self.__slots.get(s, s.default)
ntabs = 4 - (4 + len(val)) / 8
line = " %s,%s/* %s */" % (val, "\t" * ntabs, s.name)
- print >> f, line
+ print(line, file=f)
p(template.type_struct_end)
def dump_init(self, f):
def p(templ):
- print >> f, templ % self.__vars
+ print(templ % self.__vars, file=f)
p(template.type_init_type)
p(template.module_add_type)
diff --git a/Tools/framer/framer/function.py b/Tools/framer/framer/function.py
index 306f7e9..51ef861 100644
--- a/Tools/framer/framer/function.py
+++ b/Tools/framer/framer/function.py
@@ -96,7 +96,7 @@ class VarArgs(_ArgumentList):
def dump_decls(self, f):
for a in self.args:
- print >> f, " %s" % a.decl()
+ print(" %s" % a.decl(), file=f)
def ArgumentList(func, method):
code = func.func_code
@@ -135,7 +135,7 @@ class Function:
def p(templ, vars=None): # helper function to generate output
if vars is None:
vars = self.vars
- print >> f, templ % vars
+ print(templ % vars, file=f)
if self.__doc__:
p(template.docstring)
diff --git a/Tools/framer/framer/member.py b/Tools/framer/framer/member.py
index 5faf462..4838c1f 100644
--- a/Tools/framer/framer/member.py
+++ b/Tools/framer/framer/member.py
@@ -68,6 +68,6 @@ class member(object):
def dump(self, f):
if self.doc is None:
- print >> f, template.memberdef_def % self.vars
+ print(template.memberdef_def % self.vars, file=f)
else:
- print >> f, template.memberdef_def_doc % self.vars
+ print(template.memberdef_def_doc % self.vars, file=f)