Skip to content

Commit 140817f

Browse files
authored
remove with_statement future imports (#663)
1 parent 78d8859 commit 140817f

File tree

3 files changed

+0
-20
lines changed

3 files changed

+0
-20
lines changed

pyflakes/api.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
"""
22
API for the command-line I{pyflakes} tool.
33
"""
4-
from __future__ import with_statement
5-
64
import ast
75
import os
86
import platform

pyflakes/test/test_other.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,6 @@ def test_withStatementNoNames(self):
14621462
statement a name defined beforehand.
14631463
"""
14641464
self.flakes('''
1465-
from __future__ import with_statement
14661465
bar = None
14671466
with open("foo"):
14681467
bar
@@ -1475,7 +1474,6 @@ def test_withStatementSingleName(self):
14751474
within the suite or afterwards.
14761475
"""
14771476
self.flakes('''
1478-
from __future__ import with_statement
14791477
with open('foo') as bar:
14801478
bar
14811479
bar
@@ -1487,7 +1485,6 @@ def test_withStatementAttributeName(self):
14871485
C{with} statement.
14881486
"""
14891487
self.flakes('''
1490-
from __future__ import with_statement
14911488
import foo
14921489
with open('foo') as foo.bar:
14931490
pass
@@ -1499,7 +1496,6 @@ def test_withStatementSubscript(self):
14991496
C{with} statement.
15001497
"""
15011498
self.flakes('''
1502-
from __future__ import with_statement
15031499
import foo
15041500
with open('foo') as foo[0]:
15051501
pass
@@ -1511,7 +1507,6 @@ def test_withStatementSubscriptUndefined(self):
15111507
target of a C{with} statement is not defined.
15121508
"""
15131509
self.flakes('''
1514-
from __future__ import with_statement
15151510
import foo
15161511
with open('foo') as foo[bar]:
15171512
pass
@@ -1523,7 +1518,6 @@ def test_withStatementTupleNames(self):
15231518
a C{with} statement within the suite or afterwards.
15241519
"""
15251520
self.flakes('''
1526-
from __future__ import with_statement
15271521
with open('foo') as (bar, baz):
15281522
bar, baz
15291523
bar, baz
@@ -1535,7 +1529,6 @@ def test_withStatementListNames(self):
15351529
C{with} statement within the suite or afterwards.
15361530
"""
15371531
self.flakes('''
1538-
from __future__ import with_statement
15391532
with open('foo') as [bar, baz]:
15401533
bar, baz
15411534
bar, baz
@@ -1550,7 +1543,6 @@ def test_withStatementComplicatedTarget(self):
15501543
created are respected in the suite of the statement and afterwards.
15511544
"""
15521545
self.flakes('''
1553-
from __future__ import with_statement
15541546
c = d = e = g = h = i = None
15551547
with open('foo') as [(a, b), c[d], e.f, g[h:i]]:
15561548
a, b, c, d, e, g, h, i
@@ -1563,7 +1555,6 @@ def test_withStatementSingleNameUndefined(self):
15631555
C{with} statement is used before the C{with} statement.
15641556
"""
15651557
self.flakes('''
1566-
from __future__ import with_statement
15671558
bar
15681559
with open('foo') as bar:
15691560
pass
@@ -1576,7 +1567,6 @@ def test_withStatementTupleNamesUndefined(self):
15761567
C{with} statement.
15771568
"""
15781569
self.flakes('''
1579-
from __future__ import with_statement
15801570
baz
15811571
with open('foo') as (bar, baz):
15821572
pass
@@ -1588,7 +1578,6 @@ def test_withStatementSingleNameRedefined(self):
15881578
rebound by the name defined by a C{with} statement.
15891579
"""
15901580
self.flakes('''
1591-
from __future__ import with_statement
15921581
import bar
15931582
with open('foo') as bar:
15941583
pass
@@ -1601,7 +1590,6 @@ def test_withStatementTupleNamesRedefined(self):
16011590
C{with} statement.
16021591
"""
16031592
self.flakes('''
1604-
from __future__ import with_statement
16051593
import bar
16061594
with open('foo') as (bar, baz):
16071595
pass
@@ -1613,7 +1601,6 @@ def test_withStatementUndefinedInside(self):
16131601
body of a C{with} statement without first being bound.
16141602
"""
16151603
self.flakes('''
1616-
from __future__ import with_statement
16171604
with open('foo') as bar:
16181605
baz
16191606
''', m.UndefinedName)
@@ -1624,7 +1611,6 @@ def test_withStatementNameDefinedInBody(self):
16241611
the body ends without warning.
16251612
"""
16261613
self.flakes('''
1627-
from __future__ import with_statement
16281614
with open('foo') as bar:
16291615
baz = 10
16301616
baz
@@ -1636,13 +1622,11 @@ def test_withStatementUndefinedInExpression(self):
16361622
expression of a C{with} statement is undefined.
16371623
"""
16381624
self.flakes('''
1639-
from __future__ import with_statement
16401625
with bar as baz:
16411626
pass
16421627
''', m.UndefinedName)
16431628

16441629
self.flakes('''
1645-
from __future__ import with_statement
16461630
with bar as bar:
16471631
pass
16481632
''', m.UndefinedName)

setup.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/usr/bin/env python
22
# Copyright 2005-2011 Divmod, Inc.
33
# Copyright 2013 Florent Xicluna. See LICENSE file for details
4-
from __future__ import with_statement
5-
64
import os.path
75

86
try:

0 commit comments

Comments
 (0)