1. Juan-Pablo Scaletti
  2. CherryPy

Commits

Juan-Pablo Scaletti  committed b59a01b

pypy compat. Fix issue #1263

  • Participants
  • Parent commits 87de592
  • Branches default

Comments (0)

Files changed (1)

File cherrypy/wsgiserver/wsgiserver2.py

View file
     import StringIO
 DEFAULT_BUFFER_SIZE = -1
 
-_fileobject_uses_str_type = isinstance(socket._fileobject(None)._rbuf, basestring)
+class FauxSocket(object):
+    """Faux socket with the minimal interface required by pypy"""
+
+    def _reuse(self):
+        pass
+
+_fileobject_uses_str_type = isinstance(socket._fileobject(FauxSocket())._rbuf, basestring)
 
 import threading
 import time