326 """ |
326 """ |
327 # Check the "foo" part of a "with foo as bar" statement. Do this no |
327 # Check the "foo" part of a "with foo as bar" statement. Do this no |
328 # matter what, since there's always a "foo" part. |
328 # matter what, since there's always a "foo" part. |
329 self.handleNode(node.context_expr, node) |
329 self.handleNode(node.context_expr, node) |
330 |
330 |
|
331 arg = None |
331 if node.optional_vars is not None: |
332 if node.optional_vars is not None: |
332 self.handleNode(node.optional_vars, node) |
333 arg = Argument(node.optional_vars.id, node) |
333 |
334 self.addBinding(node.lineno, arg, reportRedef=False) |
334 self.handleBody(node) |
335 self.handleBody(node) |
|
336 if arg: |
|
337 del self.scope[arg.name] |
335 |
338 |
336 def GLOBAL(self, node): |
339 def GLOBAL(self, node): |
337 """ |
340 """ |
338 Keep track of globals declarations. |
341 Keep track of globals declarations. |
339 """ |
342 """ |