Skip to content

Commit 8ad538c

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

8 files changed

+9
-4
lines changed

modernize/fixes/fix_itertools_six.py

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
If itertools is imported as something else (ie: import itertools as it;
66
it.izip(spam, eggs)) method calls will not get fixed.
77
"""
8+
89
# This is a derived work of Lib/lib2to3/fixes/fix_itertools_import.py. That file
910
# is under the copyright of the Python Software Foundation and licensed
1011
# under the Python Software Foundation License 2.

modernize/fixes/fix_metaclass.py

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
This fixer also tries very hard to keep original indenting and spacing
1515
in all those corner cases.
1616
"""
17+
1718
# This is a derived work of Lib/lib2to3/fixes/fix_metaclass.py. That file
1819
# is under the copyright of the Python Software Foundation and licensed
1920
# under the Python Software Foundation License 2.

modernize/fixes/fix_raise.py

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
any client code would have to be changed as well, we don't automate
1818
this.
1919
"""
20+
2021
# Author: Collin Winter, Armin Ronacher
2122
from __future__ import generator_stop
2223

modernize/fixes/fix_raise_six.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
raise E, V, T -> six.reraise(E, V, T)
44
55
"""
6+
67
# Author : Markus Unterwaditzer
78
from __future__ import generator_stop
89

modernize/fixes/fix_urllib_six.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
This is a copy of Lib/lib2to3/fixes/fix_urllib.py, but modified to point to the
33
six.moves locations for new libraries instead of the Python 3 locations.
44
"""
5+
56
# This is a derived work of Lib/lib2to3/fixes/fix_urllib.py. That file
67
# is under the copyright of the Python Software Foundation and licensed
78
# under the Python Software Foundation License 2.

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)