summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 1c12d9c..8ed4663 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -49,6 +49,9 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#define CHECKEXC 1 /* Double-check exception checking */
#endif
+/* Global option, may be set by main() */
+int killprint;
+
/* Forward declarations */
@@ -639,6 +642,11 @@ eval_code(co, globals, locals, owner, arg)
softspace(x, 1);
err = writeobject(v, x, 0);
flushline();
+ if (killprint) {
+ err_setstr(RuntimeError,
+ "printing expression statement");
+ x = 0;
+ }
}
DECREF(v);
break;