[pypy-dev] Killing newlines in pyx source

Seo Sanghyeon tinuviel at sparcs.kaist.ac.kr
Tue Oct 7 18:07:26 MEST 2003


Hello,

I'm now playing with translator stuffs from the sprint. I tried
to read emitted Pyrex code, and found that many annoying empty
lines are generated after def line. (They are for type declarations
I guess?)

My fix is attached.
-------------- next part --------------
Index: pypy/translator/genpyrex.py
===================================================================
--- pypy/translator/genpyrex.py	(revision 1605)
+++ pypy/translator/genpyrex.py	(working copy)
@@ -144,7 +144,9 @@
         #self.putline("# %r" % self.annotations)
         for var in self.variablelocations:
             if var not in fun.startblock.input_args:
-                self.putline(self._vardecl(var))
+                decl = self._vardecl(var)
+                if decl:
+                    self.putline(decl)
         self.indent -= 1
         self.lines.extend(functionbodylines)
 


More information about the pypy-dev mailing list