mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-27 05:03:07 +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 sys
|
||||||
import shutil
|
import shutil
|
||||||
import string
|
import string
|
||||||
|
import logging
|
||||||
|
|
||||||
import supybot
|
import supybot
|
||||||
|
|
||||||
@ -340,6 +341,10 @@ if __name__ == '__main__':
|
|||||||
genDoc(Plugin, options)
|
genDoc(Plugin, options)
|
||||||
|
|
||||||
if options.clean:
|
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.log())
|
||||||
shutil.rmtree(conf.supybot.directories.conf())
|
shutil.rmtree(conf.supybot.directories.conf())
|
||||||
shutil.rmtree(conf.supybot.directories.data())
|
shutil.rmtree(conf.supybot.directories.data())
|
||||||
|
Loading…
Reference in New Issue
Block a user