aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server.py1
-rw-r--r--settings.py3
2 files changed, 3 insertions, 1 deletions
diff --git a/server.py b/server.py
index 072ed22..4de2bf5 100644
--- a/server.py
+++ b/server.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python3
from gevent import monkey
monkey.patch_all()
import gevent.socket
diff --git a/settings.py b/settings.py
index 517e785..7e988f7 100644
--- a/settings.py
+++ b/settings.py
@@ -235,6 +235,7 @@ else:
# parse settings in a safe way, without exec
settings = {}
attributes = {
+ ast.Constant: 'value',
ast.NameConstant: 'value',
ast.Num: 'n',
ast.Str: 's',
@@ -258,7 +259,7 @@ else:
log_ignored_line(node.lineno, target.id + " is not a valid setting")
continue
- if type(node.value) not in (ast.NameConstant, ast.Num, ast.Str):
+ if type(node.value) not in attributes:
log_ignored_line(node.lineno, "only literals allowed for values")
continue