mirror of
https://github.com/python/cpython.git
synced 2025-10-21 14:12:27 +00:00
Patch #1550800: make exec a function.
This commit is contained in:
parent
4e472e05bd
commit
7cae87ca7b
105 changed files with 1246 additions and 1583 deletions
|
@ -440,32 +440,6 @@ class Ellipsis(Node):
|
|||
def __repr__(self):
|
||||
return "Ellipsis()"
|
||||
|
||||
class Exec(Node):
|
||||
def __init__(self, expr, locals, globals, lineno=None):
|
||||
self.expr = expr
|
||||
self.locals = locals
|
||||
self.globals = globals
|
||||
self.lineno = lineno
|
||||
|
||||
def getChildren(self):
|
||||
children = []
|
||||
children.append(self.expr)
|
||||
children.append(self.locals)
|
||||
children.append(self.globals)
|
||||
return tuple(children)
|
||||
|
||||
def getChildNodes(self):
|
||||
nodelist = []
|
||||
nodelist.append(self.expr)
|
||||
if self.locals is not None:
|
||||
nodelist.append(self.locals)
|
||||
if self.globals is not None:
|
||||
nodelist.append(self.globals)
|
||||
return tuple(nodelist)
|
||||
|
||||
def __repr__(self):
|
||||
return "Exec(%s, %s, %s)" % (repr(self.expr), repr(self.locals), repr(self.globals))
|
||||
|
||||
class FloorDiv(Node):
|
||||
def __init__(self, (left, right), lineno=None):
|
||||
self.left = left
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue