Kaydet (Commit) c4889c49 authored tarafından Tim Peters's avatar Tim Peters

Remove now-unnecessary "from __future__ import nested_scopes" stmts.

üst 9a1ae1a9
...@@ -66,4 +66,4 @@ class _Feature: ...@@ -66,4 +66,4 @@ class _Feature:
return "Feature(" + `self.getOptionalRelease()` + ", " + \ return "Feature(" + `self.getOptionalRelease()` + ", " + \
`self.getMandatoryRelease()` + ")" `self.getMandatoryRelease()` + ")"
nested_scopes = _Feature((2, 1, 0, "beta", 1), (2, 2, 0, "final", 0)) nested_scopes = _Feature((2, 1, 0, "beta", 1), (2, 2, 0, "alpha", 0))
"""Interface to the compiler's internal symbol tables""" """Interface to the compiler's internal symbol tables"""
from __future__ import nested_scopes
import _symtable import _symtable
from _symtable import USE, DEF_GLOBAL, DEF_LOCAL, DEF_PARAM, \ from _symtable import USE, DEF_GLOBAL, DEF_LOCAL, DEF_PARAM, \
......
from __future__ import nested_scopes
tutorial_tests = """ tutorial_tests = """
Let's try a simple generator: Let's try a simple generator:
......
from __future__ import nested_scopes
from test.test_support import verify, TestFailed, check_syntax from test.test_support import verify, TestFailed, check_syntax
print "1. simple nesting" print "1. simple nesting"
...@@ -179,7 +177,7 @@ verify(f(6) == 720) ...@@ -179,7 +177,7 @@ verify(f(6) == 720)
print "11. unoptimized namespaces" print "11. unoptimized namespaces"
check_syntax("""from __future__ import nested_scopes check_syntax("""\
def unoptimized_clash1(strip): def unoptimized_clash1(strip):
def f(s): def f(s):
from string import * from string import *
...@@ -187,7 +185,7 @@ def unoptimized_clash1(strip): ...@@ -187,7 +185,7 @@ def unoptimized_clash1(strip):
return f return f
""") """)
check_syntax("""from __future__ import nested_scopes check_syntax("""\
def unoptimized_clash2(): def unoptimized_clash2():
from string import * from string import *
def f(s): def f(s):
...@@ -195,7 +193,7 @@ def unoptimized_clash2(): ...@@ -195,7 +193,7 @@ def unoptimized_clash2():
return f return f
""") """)
check_syntax("""from __future__ import nested_scopes check_syntax("""\
def unoptimized_clash2(): def unoptimized_clash2():
from string import * from string import *
def g(): def g():
...@@ -205,7 +203,7 @@ def unoptimized_clash2(): ...@@ -205,7 +203,7 @@ def unoptimized_clash2():
""") """)
# XXX could allow this for exec with const argument, but what's the point # XXX could allow this for exec with const argument, but what's the point
check_syntax("""from __future__ import nested_scopes check_syntax("""\
def error(y): def error(y):
exec "a = 1" exec "a = 1"
def f(x): def f(x):
...@@ -213,14 +211,14 @@ def error(y): ...@@ -213,14 +211,14 @@ def error(y):
return f return f
""") """)
check_syntax("""from __future__ import nested_scopes check_syntax("""\
def f(x): def f(x):
def g(): def g():
return x return x
del x # can't del name del x # can't del name
""") """)
check_syntax("""from __future__ import nested_scopes check_syntax("""\
def f(): def f():
def g(): def g():
from string import * from string import *
......
# Remove all the .pyc and .pyo files under ../Lib. # Remove all the .pyc and .pyo files under ../Lib.
from __future__ import nested_scopes
def deltree(root): def deltree(root):
import os import os
def rm(path): def rm(path):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment