]> granicus.if.org Git - python/commitdiff
The minidom.Node class has a debug attribute which, when its _debug
authorGuido van Rossum <guido@python.org>
Thu, 21 Sep 2000 20:10:39 +0000 (20:10 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 21 Sep 2000 20:10:39 +0000 (20:10 +0000)
flag is true, is set to a StringIO object that silently collects all
debug messages.  This is triggered by the Node._debug=1 statement at
the top of test_minidom.py.  After the tests, we better delete that
StringIO object to avoid wasting memory.  We also reset the _debug
flag.  (Note that this is an undetectable memory leak, and the memory
doesn't get collected by the cycle-gc either, because it's all
reachable -- it's just useless.)

Lib/test/test_minidom.py

index 05612b24f63c8ddbc7fde123ec05c15db6fe8784..3c47b0b1da57ed5f8f99cc142f38e67cced4810c 100644 (file)
@@ -356,3 +356,5 @@ if works:
 else:
     print "\n\n\n\n************ Check for failures!"
 
+Node.debug = None # Delete debug output collected in a StringIO object
+Node._debug = 0   # And reset debug mode