From f6ccc126a3765e0a514e37c7fb2fdfbb08e3dba9 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Mon, 29 Sep 2003 04:41:18 +0000 Subject: [PATCH] Added debug.reset, necessary for helping out testing. --- src/debug.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/debug.py b/src/debug.py index 478c4b73a..be549bd8b 100644 --- a/src/debug.py +++ b/src/debug.py @@ -105,6 +105,18 @@ priorityColors.setdefault('') # If the most recent time is lastTimes = [time.time()-1] * 10 +def reset(): + global _errorfd, _debugfd, _tracefd + _errorfd.flush() + _errorfd.close() + _errorfd = file(_errorfd.name, 'a') + _debugfd.flush() + _debugfd.close() + _debugfd = file(_errorfd.name, 'a') + _tracefd.flush() + _tracefd.close() + _tracefd = file(_errorfd.name, 'w') + def exit(i=-1): class E(Exception): pass