[ctypes-commit] ctypes/sandbox/tools/codegen cparser.py,1.4,1.5
Brought to you by:
theller
From: Thomas H. <th...@us...> - 2005-01-21 11:00:45
|
Update of /cvsroot/ctypes/ctypes/sandbox/tools/codegen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13273 Modified Files: cparser.py Log Message: Work around strange text mode. Index: cparser.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/sandbox/tools/codegen/cparser.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** cparser.py 21 Jan 2005 10:43:56 -0000 1.4 --- cparser.py 21 Jan 2005 11:00:37 -0000 1.5 *************** *** 42,47 **** try: args = ["gccxml", "--preprocess", "-dM", fname] ! if self.options.flags: args.append(self.options.flags) i, o = os.popen4(" ".join(args)) i.close() --- 42,48 ---- try: args = ["gccxml", "--preprocess", "-dM", fname] ! if lines and self.options.flags: args.append(self.options.flags) + print "run", " ".join(args) i, o = os.popen4(" ".join(args)) i.close() *************** *** 233,240 **** if self.options.xmlfile: f = open(self.options.xmlfile, "r+") ! f.seek(-11, 2) data = f.read() ! assert data == "</GCC_XML>\n" ! f.seek(-11, 2) f.flush() --- 234,248 ---- if self.options.xmlfile: f = open(self.options.xmlfile, "r+") ! f.seek(-12, 2) data = f.read() ! if len(data) == 11: ! # text mode on windows is strange. You read 12 ! # characters, but get 11. ! assert data == "</GCC_XML>\n" ! f.seek(-12, 2) ! else: ! # linux, ... ! assert data == "\n</GCC_XML>\n" ! f.seek(-11, 2) f.flush() |