Broke reset up into two component functions which will have to be called separately to fix testing in Windows, I'm sure.

This commit is contained in:
Jeremy Fincher 2003-10-05 03:39:57 +00:00
parent e5525cd7da
commit 5025f200c6
1 changed files with 13 additions and 5 deletions

View File

@ -105,18 +105,26 @@ priorityColors.setdefault('')
# If the most recent time is
lastTimes = [time.time()-1] * 10
def reset():
"""Resets the various file descriptors kept open by this module."""
global _errorfd, _debugfd, _tracefd
def _close():
"""Implementation detail; needed because Windows sucks."""
_errorfd.flush()
_errorfd.close()
_errorfd = file(_errorfd.name, 'a')
_debugfd.flush()
_debugfd.close()
_debugfd = file(_errorfd.name, 'a')
_tracefd.flush()
_tracefd.close()
def _open():
"""Implementation details; needed because Windows sucks."""
global _errorfd, _debugfd, _tracefd
_errorfd = file(_errorfd.name, 'a')
_debugfd = file(_errorfd.name, 'a')
_tracefd = file(_errorfd.name, 'w')
def reset():
"""Resets the various file descriptors kept open by this module."""
_close()
_open()
def exit(i=-1):
"""Makes sure to actually exit."""