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

View File

@ -105,19 +105,27 @@ priorityColors.setdefault('')
# If the most recent time is # If the most recent time is
lastTimes = [time.time()-1] * 10 lastTimes = [time.time()-1] * 10
def reset(): def _close():
"""Resets the various file descriptors kept open by this module.""" """Implementation detail; needed because Windows sucks."""
global _errorfd, _debugfd, _tracefd
_errorfd.flush() _errorfd.flush()
_errorfd.close() _errorfd.close()
_errorfd = file(_errorfd.name, 'a')
_debugfd.flush() _debugfd.flush()
_debugfd.close() _debugfd.close()
_debugfd = file(_errorfd.name, 'a')
_tracefd.flush() _tracefd.flush()
_tracefd.close() _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') _tracefd = file(_errorfd.name, 'w')
def reset():
"""Resets the various file descriptors kept open by this module."""
_close()
_open()
def exit(i=-1): def exit(i=-1):
"""Makes sure to actually exit.""" """Makes sure to actually exit."""
class E(Exception): class E(Exception):