Changeset 85

Show
Ignore:
Timestamp:
06/13/07 20:16:51
Author:
bbangert
Message:

Swapping has_key for 'not in' for future compatibility (also marginally faster).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • AuthKit/branches/0.4/authkit/permissions.py

    r81 r85  
    108108       
    109109    def check(self, app, environ, start_response): 
    110         if not environ.has_key('REMOTE_USER')
     110        if 'REMOTE_USER' not in environ
    111111            raise NotAuthenticatedError('Not Authenticated') 
    112112        if environ['REMOTE_USER'] not in self.users: 
     
    133133     
    134134    def check(self, app, environ, start_response): 
    135         if not environ.has_key(self.key)
     135        if self.key not in environ
    136136            raise self.error 
    137137        return app(environ, start_response) 
     
    170170 
    171171    def check(self, app, environ, start_response): 
    172         if not environ.has_key('REMOTE_USER')
     172        if 'REMOTE_USER' not in environ
    173173            raise NotAuthenticatedError('Not Authenticated') 
    174174        elif self.accept_empty==False and not environ['REMOTE_USER']: 
     
    294294     
    295295    def check(self, app, environ, start_response): 
    296         if not environ.has_key('authkit.users')
     296        if 'authkit.users' not in environ
    297297            raise no_authkit_users_in_environ 
    298298        if not environ.get('REMOTE_USER'): 
     
    316316         
    317317    def check(self, app, environ, start_response): 
    318         if not environ.has_key(self.key)
     318        if self.key not in environ
    319319            raise Exception( 
    320320                "No such key %r in environ so cannot check the host"%self.key