1. Tavis Rudd
  2. eventlet-tr

Commits

Tavis Rudd  committed edab614

added code quality comment about masking of `locals` builtin

  • Participants
  • Parent commits ff4f19a
  • Branches default

Comments (0)

Files changed (1)

File eventlet/backdoor.py

View file
     def __getattr__(self, attr):
         fixups = object.__getattribute__(self, 'fixups')
         if attr in fixups:
-            return fixups[attr]    
+            return fixups[attr]
         f = object.__getattribute__(self, 'f')
         return getattr(f, attr)
 
-
+# @@tavis: the `locals` args below mask the built-in function.  Should
+# be renamed.
 class SocketConsole(greenlets.greenlet):
     def __init__(self, desc, hostport, locals):
         self.hostport = hostport
 
 
 def backdoor_server(sock, locals=None):
-    """ Blocking function that runs a backdoor server on the socket *sock*, 
+    """ Blocking function that runs a backdoor server on the socket *sock*,
     accepting connections and running backdoor consoles for each client that
     connects.
-    
+
     The *locals* argument is a dictionary that will be included in the locals()
-    of the interpreters.  It can be convenient to stick important application 
+    of the interpreters.  It can be convenient to stick important application
     variables in here.
     """
     print "backdoor server listening on %s:%s" % sock.getsockname()
 
 def backdoor((conn, addr), locals=None):
     """Sets up an interactive console on a socket with a single connected
-    client.  This does not block the caller, as it spawns a new greenlet to 
+    client.  This does not block the caller, as it spawns a new greenlet to
     handle the console.  This is meant to be called from within an accept loop
     (such as backdoor_server).
     """
 
 if __name__ == '__main__':
     backdoor_server(eventlet.listen(('127.0.0.1', 9000)), {})
-