Blame SOURCES/00125-less-verbose-COUNT_ALLOCS.patch

ae2451
diff -up Python-2.7/Python/pythonrun.c.less-verbose-COUNT_ALLOCS Python-2.7/Python/pythonrun.c
ae2451
--- Python-2.7/Python/pythonrun.c.less-verbose-COUNT_ALLOCS	2010-08-17 14:49:33.321913909 -0400
ae2451
+++ Python-2.7/Python/pythonrun.c	2010-08-17 14:54:48.750910403 -0400
ae2451
@@ -470,7 +470,15 @@ Py_Finalize(void)
ae2451
 
ae2451
     /* Debugging stuff */
ae2451
 #ifdef COUNT_ALLOCS
ae2451
-    dump_counts(stdout);
ae2451
+    /* This is a downstream Fedora modification.
ae2451
+       The upstream default with COUNT_ALLOCS is to always dump the counts to
ae2451
+       stdout on exit.  For our debug builds its useful to have the info from
ae2451
+       COUNT_ALLOCS available, but the stdout info here gets in the way, so
ae2451
+       we make it optional, wrapping it in an environment variable (modelled
ae2451
+       on the other PYTHONDUMP* env variables):
ae2451
+    */
ae2451
+    if (Py_GETENV("PYTHONDUMPCOUNTS"))
ae2451
+        dump_counts(stdout);
ae2451
 #endif
ae2451
 
ae2451
     PRINT_TOTAL_REFS();