only check this when parsing python
diff --git a/Parser/parsetok.c b/Parser/parsetok.c
index 9b2d730..ad5f7ba 100644
--- a/Parser/parsetok.c
+++ b/Parser/parsetok.c
@@ -225,6 +225,7 @@
         n = ps->p_tree;
         ps->p_tree = NULL;
 
+#ifndef PGEN
         /* Check that the source for a single input statement really
            is a single statement by looking at what is left in the
            buffer after parsing.  Trailing whitespace and comments
@@ -241,6 +242,7 @@
                 n = NULL;
             }
         }
+#endif
     }
     else
         n = NULL;