mirror of
https://github.com/django/django.git
synced 2025-10-29 00:26:07 +00:00
Changed a whole bunch of places to raise exception instances instead of old-style raising exception classes plus a comma. Good for the future Python 3 conversion
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12180 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -51,9 +51,9 @@ def serve(request, path, document_root=None, show_indexes=False):
|
||||
if os.path.isdir(fullpath):
|
||||
if show_indexes:
|
||||
return directory_index(newpath, fullpath)
|
||||
raise Http404, "Directory indexes are not allowed here."
|
||||
raise Http404("Directory indexes are not allowed here.")
|
||||
if not os.path.exists(fullpath):
|
||||
raise Http404, '"%s" does not exist' % fullpath
|
||||
raise Http404('"%s" does not exist' % fullpath)
|
||||
# Respect the If-Modified-Since header.
|
||||
statobj = os.stat(fullpath)
|
||||
mimetype = mimetypes.guess_type(fullpath)[0] or 'application/octet-stream'
|
||||
|
||||
Reference in New Issue
Block a user