Skip to content

Commit 195aeb7

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 1de52bf commit 195aeb7

15 files changed

+4
-16
lines changed

modernize/fixes/fix_file.py

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66

77
class FixFile(fixer_base.BaseFix):
8-
98
BM_compatible = True
109
order = "pre"
1110

modernize/fixes/fix_filter.py

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111

1212
class FixFilter(fix_filter.FixFilter):
13-
1413
skip_on = "six.moves.filter"
1514

1615
def transform(self, node, results):

modernize/fixes/fix_import.py

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88

99
class FixImport(fix_import.FixImport):
10-
1110
# Make sure this runs before any other fixer to guarantee that any other
1211
# added absolute_import doesn't block this fixer's execution.
1312
run_order = 1

modernize/fixes/fix_imports_six.py

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55

66
class FixImportsSix(fix_imports.FixImports):
7-
87
mapping = {
98
"__builtin__": "six.moves.builtins",
109
"_winreg": "six.moves.winreg",

modernize/fixes/fix_input_six.py

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616

1717
class FixInputSix(fixer_base.ConditionalFix):
18-
1918
BM_compatible = True
2019
order = "pre"
2120
skip_on = "six.moves.input"

modernize/fixes/fix_int_long_tuple.py

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55

66
class FixIntLongTuple(fixer_base.BaseFix):
7-
87
run_order = 4 # Must run before fix_long.
98

109
PATTERN = """

modernize/fixes/fix_map.py

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111

1212
class FixMap(fix_map.FixMap):
13-
1413
skip_on = "six.moves.map"
1514

1615
def transform(self, node, results):

modernize/fixes/fix_open.py

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55

66
class FixOpen(fixer_base.BaseFix):
7-
87
BM_compatible = True
98
# Fixers don't directly stack, so make sure the 'file' case is covered.
109
PATTERN = """

modernize/fixes/fix_raise_six.py

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313

1414
class FixRaiseSix(fixer_base.BaseFix):
15-
1615
BM_compatible = True
1716
PATTERN = """
1817
raise_stmt< 'raise' exc=any ',' val=any ',' tb=any >

modernize/fixes/fix_xrange_six.py

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99

1010
class FixXrangeSix(fixer_base.ConditionalFix, fix_xrange.FixXrange):
11-
1211
skip_on = "six.moves.range"
1312

1413
def transform(self, node, results):

modernize/fixes/fix_zip.py

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99

1010
class FixZip(fix_zip.FixZip):
11-
1211
skip_on = "six.moves.zip"
1312

1413
def transform(self, node, results):

modernize/utils.py

-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ def _check_future_import(node):
5151

5252

5353
def add_future(node, symbol):
54-
5554
root = fixer_util.find_root(node)
5655

5756
for idx, node in enumerate(root.children):

tests/test_fix_imports_six.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import unittest
55

66
try:
7-
from six.moves import tkinter
7+
import tkinter
88
except ImportError:
99
tkinter = None
1010

tests/test_future_behaviour.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def _check_on_input(file_content, extra_flags=[]):
6666
try:
6767
tmpdirname = tempfile.mkdtemp()
6868
test_input_name = os.path.join(tmpdirname, "input.py")
69-
with open(test_input_name, "wt") as input:
69+
with open(test_input_name, "w") as input:
7070
input.write(file_content)
7171
modernize_main(extra_flags + ["-w", test_input_name])
7272
_check_for_multiple_futures(test_input_name, file_content)
@@ -94,7 +94,7 @@ def test_two_files_on_single_run():
9494
os.path.join(tmpdirname, f"input_{idx}.py") for idx in range(0, 3)
9595
]
9696
for input_name in input_names:
97-
with open(input_name, "wt") as input:
97+
with open(input_name, "w") as input:
9898
input.write(TWO_PRINTS_CONTENT)
9999
modernize_main(["-w"] + input_names)
100100
for input_name in input_names:

tests/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def check_on_input(
2323
tmpdirname = tempfile.mkdtemp()
2424
try:
2525
test_input_name = os.path.join(tmpdirname, "input.py")
26-
with open(test_input_name, "wt") as input_file:
26+
with open(test_input_name, "w") as input_file:
2727
input_file.write(input_content)
2828

2929
def _check(this_input_content, which_check, check_return_code=True):

0 commit comments

Comments
 (0)