running lib2to3.fixes.fix_except
This commit is contained in:
+3
-3
@@ -56,7 +56,7 @@ def stream_file_or_304_or_206(
|
||||
try:
|
||||
open = file # this makes no sense but without it GAE cannot open files
|
||||
fp = open(static_file,'rb')
|
||||
except IOError, e:
|
||||
except IOError as e:
|
||||
if e[0] == errno.EISDIR:
|
||||
raise HTTP(403, error_message, web2py_error='file is a directory')
|
||||
elif e[0] == errno.EACCES:
|
||||
@@ -90,7 +90,7 @@ def stream_file_or_304_or_206(
|
||||
bytes = part[1] - part[0] + 1
|
||||
try:
|
||||
stream = open(static_file, 'rb')
|
||||
except IOError, e:
|
||||
except IOError as e:
|
||||
if e[0] in (errno.EISDIR, errno.EACCES):
|
||||
raise HTTP(403)
|
||||
else:
|
||||
@@ -111,7 +111,7 @@ def stream_file_or_304_or_206(
|
||||
headers['Vary'] = 'Accept-Encoding'
|
||||
try:
|
||||
stream = open(static_file, 'rb')
|
||||
except IOError, e:
|
||||
except IOError as e:
|
||||
# this better does not happer when returning an error page ;-)
|
||||
if e[0] in (errno.EISDIR, errno.EACCES):
|
||||
raise HTTP(403)
|
||||
|
||||
Reference in New Issue
Block a user