diff --git a/modernize/fixes/fix_itertools_six.py b/modernize/fixes/fix_itertools_six.py index b6ff62a..8880ec1 100644 --- a/modernize/fixes/fix_itertools_six.py +++ b/modernize/fixes/fix_itertools_six.py @@ -5,6 +5,7 @@ If itertools is imported as something else (ie: import itertools as it; it.izip(spam, eggs)) method calls will not get fixed. """ + # This is a derived work of Lib/lib2to3/fixes/fix_itertools_import.py. That file # is under the copyright of the Python Software Foundation and licensed # under the Python Software Foundation License 2. diff --git a/modernize/fixes/fix_metaclass.py b/modernize/fixes/fix_metaclass.py index 2bccdb9..15f1574 100644 --- a/modernize/fixes/fix_metaclass.py +++ b/modernize/fixes/fix_metaclass.py @@ -14,6 +14,7 @@ This fixer also tries very hard to keep original indenting and spacing in all those corner cases. """ + # This is a derived work of Lib/lib2to3/fixes/fix_metaclass.py. That file # is under the copyright of the Python Software Foundation and licensed # under the Python Software Foundation License 2. diff --git a/modernize/fixes/fix_raise.py b/modernize/fixes/fix_raise.py index 68ef28c..97ef8b6 100644 --- a/modernize/fixes/fix_raise.py +++ b/modernize/fixes/fix_raise.py @@ -17,6 +17,7 @@ any client code would have to be changed as well, we don't automate this. """ + # Author: Collin Winter, Armin Ronacher from __future__ import generator_stop diff --git a/modernize/fixes/fix_raise_six.py b/modernize/fixes/fix_raise_six.py index 54f4f7a..71b5f85 100644 --- a/modernize/fixes/fix_raise_six.py +++ b/modernize/fixes/fix_raise_six.py @@ -3,6 +3,7 @@ raise E, V, T -> six.reraise(E, V, T) """ + # Author : Markus Unterwaditzer from __future__ import generator_stop diff --git a/modernize/fixes/fix_urllib_six.py b/modernize/fixes/fix_urllib_six.py index 39733fb..e85e239 100644 --- a/modernize/fixes/fix_urllib_six.py +++ b/modernize/fixes/fix_urllib_six.py @@ -2,6 +2,7 @@ This is a copy of Lib/lib2to3/fixes/fix_urllib.py, but modified to point to the six.moves locations for new libraries instead of the Python 3 locations. """ + # This is a derived work of Lib/lib2to3/fixes/fix_urllib.py. That file # is under the copyright of the Python Software Foundation and licensed # under the Python Software Foundation License 2. diff --git a/tests/test_fix_imports_six.py b/tests/test_fix_imports_six.py index 66df698..711945a 100644 --- a/tests/test_fix_imports_six.py +++ b/tests/test_fix_imports_six.py @@ -4,7 +4,7 @@ import unittest try: - from six.moves import tkinter + import tkinter except ImportError: tkinter = None diff --git a/tests/test_future_behaviour.py b/tests/test_future_behaviour.py index e6fba63..92a08cc 100644 --- a/tests/test_future_behaviour.py +++ b/tests/test_future_behaviour.py @@ -66,7 +66,7 @@ def _check_on_input(file_content, extra_flags=[]): try: tmpdirname = tempfile.mkdtemp() test_input_name = os.path.join(tmpdirname, "input.py") - with open(test_input_name, "wt") as input: + with open(test_input_name, "w") as input: input.write(file_content) modernize_main(extra_flags + ["-w", test_input_name]) _check_for_multiple_futures(test_input_name, file_content) @@ -94,7 +94,7 @@ def test_two_files_on_single_run(): os.path.join(tmpdirname, f"input_{idx}.py") for idx in range(0, 3) ] for input_name in input_names: - with open(input_name, "wt") as input: + with open(input_name, "w") as input: input.write(TWO_PRINTS_CONTENT) modernize_main(["-w"] + input_names) for input_name in input_names: diff --git a/tests/utils.py b/tests/utils.py index 6f84434..1c8d610 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -23,7 +23,7 @@ def check_on_input( tmpdirname = tempfile.mkdtemp() try: test_input_name = os.path.join(tmpdirname, "input.py") - with open(test_input_name, "wt") as input_file: + with open(test_input_name, "w") as input_file: input_file.write(input_content) def _check(this_input_content, which_check, check_return_code=True):