mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-26 04:32:51 +01:00
supybot-plugin-doc: Fix exceptions raised while exiting the script.
This commit is contained in:
parent
828fff9cc0
commit
2d2241787f
@ -35,6 +35,7 @@ import os
|
||||
import sys
|
||||
import shutil
|
||||
import string
|
||||
import logging
|
||||
|
||||
import supybot
|
||||
|
||||
@ -340,6 +341,10 @@ if __name__ == '__main__':
|
||||
genDoc(Plugin, options)
|
||||
|
||||
if options.clean:
|
||||
# We are about to remove the log dir; so trying to write anything
|
||||
# (such as "Shutdown initiated." and friends, from atexit callbacks)
|
||||
# would result in errors.
|
||||
log._handler.setLevel(logging.CRITICAL)
|
||||
shutil.rmtree(conf.supybot.directories.log())
|
||||
shutil.rmtree(conf.supybot.directories.conf())
|
||||
shutil.rmtree(conf.supybot.directories.data())
|
||||
|
Loading…
Reference in New Issue
Block a user