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:
+1
-1
@@ -392,7 +392,7 @@ def wsgibase(environ, responder):
|
|||||||
elif not request.is_local and exists(disabled):
|
elif not request.is_local and exists(disabled):
|
||||||
five0three = os.path.join(request.folder, 'static', '503.html')
|
five0three = os.path.join(request.folder, 'static', '503.html')
|
||||||
if os.path.exists(five0three):
|
if os.path.exists(five0three):
|
||||||
raise HTTP(503, file(five0three, 'r').read())
|
raise HTTP(503, open(five0three, 'r').read())
|
||||||
else:
|
else:
|
||||||
raise HTTP(503, "<html><body><h1>Temporarily down for maintenance</h1></body></html>")
|
raise HTTP(503, "<html><body><h1>Temporarily down for maintenance</h1></body></html>")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user