1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

[py3] Ported django.core.servers.

This commit is contained in:
Aymeric Augustin
2012-08-16 13:01:16 +02:00
parent 8c356acf2e
commit fcc8de0598
2 changed files with 19 additions and 13 deletions

View File

@@ -7,6 +7,8 @@ This is a simple server for use in testing or debugging Django apps. It hasn't
been reviewed for security issues. DON'T USE IT FOR PRODUCTION USE!
"""
from __future__ import unicode_literals
import os
import socket
import sys
@@ -71,12 +73,12 @@ class WSGIServerException(Exception):
class ServerHandler(simple_server.ServerHandler, object):
error_status = "500 INTERNAL SERVER ERROR"
error_status = str("500 INTERNAL SERVER ERROR")
def write(self, data):
"""'write()' callable as specified by PEP 333"""
"""'write()' callable as specified by PEP 3333"""
assert isinstance(data, str), "write() argument must be string"
assert isinstance(data, bytes), "write() argument must be bytestring"
if not self.status:
raise AssertionError("write() before start_response()")