Add support for Python 3.8/nightly.

This commit is contained in:
Valentin Lorentz 2019-01-06 18:08:15 +01:00
parent 7adc958dd6
commit b051537f7f
2 changed files with 20 additions and 3 deletions

View File

@ -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:

View File

@ -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):