diff --git a/webinterface.py b/webinterface.py index 66601f1..6ac1ff6 100644 --- a/webinterface.py +++ b/webinterface.py @@ -1,5 +1,5 @@ #!/usr/bin/python -import cherrypy, pronterface, re, ConfigParser, threading +import cherrypy, pronterface, re, ConfigParser, threading, sys import os.path users = {} @@ -233,7 +233,11 @@ class XMLstatus(object): class WebInterface(object): def __init__(self, pface): - config = ConfigParser.SafeConfigParser(allow_no_value=True) + if (sys.version_info[1] > 6): + # 'allow_no_value' wasn't added until 2.7 + config = ConfigParser.SafeConfigParser(allow_no_value=True) + else: + config = ConfigParser.SafeConfigParser() config.read('auth.config') users[config.get("user", "user")] = config.get("user", "pass") self.pface = pface @@ -369,4 +373,4 @@ def StartWebInterfaceThread(webInterface): if __name__ == '__main__': cherrypy.config.update("http.config") - cherrypy.quickstart(WebInterfaceStub()) \ No newline at end of file + cherrypy.quickstart(WebInterfaceStub())