Commits

Anonymous committed ca9f82e

Removed my b2 and my implementation of fixing builtin_server.

Comments (0)

Files changed (3)

django/core/servers/basehttp.py

 from django.core.management.color import color_style
 from django.utils.http import http_date
 from django.utils._os import safe_join
-from django.utils.py3 import b, b2, bytes
+from django.utils.py3 import b, bytes
 
 __version__ = "0.1"
 __all__ = ['WSGIServer','WSGIRequestHandler']
         """
         if not self.result_is_file() or not self.sendfile():
             for data in self.result:
-                self.write(b2(data))
+                self.write(b(data))
             self.finish_content()
         self.close()
 
         """Transmit version/status/date/server, via self._write()"""
         if self.origin_server:
             if self.client_is_modern():
-                self._write(b2('HTTP/%s %s\r\n' % (self.http_version,self.status)))
+                self._write(b('HTTP/%s %s\r\n' % (self.http_version,self.status)))
                 if 'Date' not in self.headers:
                     self._write(
-                        b2('Date: %s\r\n' % http_date())
+                        b('Date: %s\r\n' % http_date())
                     )
                 if self.server_software and 'Server' not in self.headers:
-                    self._write(b2('Server: %s\r\n' % self.server_software))
+                    self._write(b('Server: %s\r\n' % self.server_software))
         else:
-            self._write(b2('Status: %s\r\n' % self.status))
+            self._write(b('Status: %s\r\n' % self.status))
 
     def write(self, data):
         """'write()' callable as specified by PEP 333"""
         self.headers_sent = True
         if not self.origin_server or self.client_is_modern():
             self.send_preamble()
-            self._write(b2(str(self.headers)))
+            self._write(b(str(self.headers)))
 
     def result_is_file(self):
         """True if 'self.result' is an instance of 'self.wsgi_file_wrapper'"""

django/utils/py3.py

     u = str
     next = __builtins__['next']
 
-#Helper function used in basehttp. Returns: (py2.x): "ascii" (py3): "unicode"
-def b2(s):
-    if sys.version_info < (3,0):
-        return b(s)
-    else:
-        return s

tests/regressiontests/dispatch/tests/test_saferef.py

 
 class Tester(unittest.TestCase):
     def setUp(self):
-        print("WTF")
         ts = []
         ss = []
         for x in xrange(5000):
             ss.append(s)
         ts.append(test2)
         ss.append(safeRef(test2, self._closure))
-        print("__________________")
         for x in xrange(30): # below it goes to "B" weakref.ref(target, onDelete)
             t = Test2()
             ts.append(t)
         self.ts = ts
         self.ss = ss
         self.closureCount = 0
-        print("__________________")
     
     def tearDown(self):
         del self.ts