Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1456

Show
Ignore:
Timestamp:
11/29/06 00:20:22
Author:
fumanchu
Message:

Fix for #609 (Support for IronPython? 1.0).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/_cptools.py

    r1431 r1456  
    5252                setattr(self, arg, None) 
    5353        except (ImportError, AttributeError): 
     54            pass 
     55        # IronPython 1.0 raises NotImplementedError because 
     56        # inspect.getargspec tries to access Python bytecode 
     57        # in co_code attribute. 
     58        except NotImplementedError: 
    5459            pass 
    5560     
  • trunk/cherrypy/_cpwsgiserver.py

    r1448 r1456  
    431431        self.environ = self.environ.copy() 
    432432         
    433         if type(sock) is socket.socket: 
    434             self.rfile = self.socket.makefile("r", self.rbufsize) 
    435             self.wfile = self.socket.makefile("w", self.wbufsize) 
    436         else: 
    437             # Assume it's an HTTPS socket wrapper 
     433        if SSL and isinstance(sock, SSL.ConnectionType): 
    438434            self.rfile = SSL_fileobject(sock, "r", self.rbufsize) 
    439435            self.wfile = SSL_fileobject(sock, "w", self.wbufsize) 
     
    443439            if sslenv: 
    444440                self.environ.update(sslenv) 
     441        else: 
     442            self.rfile = self.socket.makefile("r", self.rbufsize) 
     443            self.wfile = self.socket.makefile("w", self.wbufsize) 
    445444         
    446445        self.environ.update({"wsgi.input": self.rfile, 
     
    790789                           ("S", cert.get_subject())]: 
    791790            # X509Name objects don't seem to have a way to get the 
    792             # complete DN string. Use str() and slice it instead. 
     791            # complete DN string. Use str() and slice it instead, 
     792            # because str(dn) == "<X509Name object '/C=US/ST=...'>" 
    793793            dnstr = str(dn)[18:-2] 
    794794             
  • trunk/cherrypy/lib/__init__.py

    r1312 r1456  
    111111        return s 
    112112     
    113     import compiler 
     113    try: 
     114        import compiler 
     115    except ImportError: 
     116        # Fallback to eval when compiler package is not available, 
     117        # e.g. IronPython 1.0. 
     118        return eval(s) 
     119     
    114120    p = compiler.parse("a=" + s) 
    115121    obj = p.getChildren()[1].getChildren()[0].getChildren()[1] 

Hosted by WebFaction

Log in as guest/cpguest to create tickets