Changed file to open

file is deprecated in python 3, but open works on both. So for compatibility I would suggest to use open over file.
This commit is contained in:
Robin
2018-05-08 11:00:35 +02:00
committed by GitHub
parent 4ed36cfb1f
commit 16e3e7c35e
+1 -1
View File
@@ -392,7 +392,7 @@ def wsgibase(environ, responder):
elif not request.is_local and exists(disabled):
five0three = os.path.join(request.folder, 'static', '503.html')
if os.path.exists(five0three):
raise HTTP(503, file(five0three, 'r').read())
raise HTTP(503, open(five0three, 'r').read())
else:
raise HTTP(503, "<html><body><h1>Temporarily down for maintenance</h1></body></html>")