mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-02 07:34:08 +01:00
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:
parent
e5525cd7da
commit
5025f200c6
18
src/debug.py
18
src/debug.py
@ -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."""
|
||||
|
Loading…
Reference in New Issue
Block a user