mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 03:33:11 +01:00
Add support for Python 3.8/nightly.
This commit is contained in:
parent
7adc958dd6
commit
b051537f7f
20
src/log.py
20
src/log.py
@ -198,8 +198,17 @@ except EnvironmentError as e:
|
||||
'error was: %s' % (messagesLogFilename, utils.gen.exnToString(e)))
|
||||
|
||||
# These are public.
|
||||
formatter = Formatter('NEVER SEEN; IF YOU SEE THIS, FILE A BUG!')
|
||||
pluginFormatter = PluginFormatter('NEVER SEEN; IF YOU SEE THIS, FILE A BUG!')
|
||||
if sys.version_info >= (3, 8):
|
||||
formatter = Formatter(
|
||||
'NEVER SEEN; IF YOU SEE THIS, FILE A BUG!', validate=False)
|
||||
pluginFormatter = PluginFormatter(
|
||||
'NEVER SEEN; IF YOU SEE THIS, FILE A BUG!', validate=False)
|
||||
|
||||
else:
|
||||
formatter = Formatter(
|
||||
'NEVER SEEN; IF YOU SEE THIS, FILE A BUG!')
|
||||
pluginFormatter = PluginFormatter(
|
||||
'NEVER SEEN; IF YOU SEE THIS, FILE A BUG!')
|
||||
|
||||
# These are not.
|
||||
logging.setLoggerClass(Logger)
|
||||
@ -409,7 +418,12 @@ _handler.setLevel(conf.supybot.log.level())
|
||||
_logger.addHandler(_handler)
|
||||
_logger.setLevel(-1)
|
||||
|
||||
_stdoutFormatter = ColorizedFormatter('IF YOU SEE THIS, FILE A BUG!')
|
||||
if sys.version_info >= (3, 8):
|
||||
_stdoutFormatter = ColorizedFormatter(
|
||||
'IF YOU SEE THIS, FILE A BUG!', validate=False)
|
||||
else:
|
||||
_stdoutFormatter = ColorizedFormatter(
|
||||
'IF YOU SEE THIS, FILE A BUG!')
|
||||
_stdoutHandler.setFormatter(_stdoutFormatter)
|
||||
_stdoutHandler.setLevel(conf.supybot.log.stdout.level())
|
||||
if not conf.daemonized:
|
||||
|
@ -196,6 +196,9 @@ def safeEval(s, namespace=None):
|
||||
elif sys.version_info[0:2] >= (3, 4) and \
|
||||
node.__class__ is ast.NameConstant:
|
||||
return True
|
||||
elif sys.version_info[0:2] >= (3, 8) and \
|
||||
node.__class__ is ast.Constant:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
if checkNode(node):
|
||||
|
Loading…
Reference in New Issue
Block a user