diff --git a/modernize/fixes/fix_file.py b/modernize/fixes/fix_file.py index 35581b8..65378b3 100644 --- a/modernize/fixes/fix_file.py +++ b/modernize/fixes/fix_file.py @@ -5,7 +5,6 @@ class FixFile(fixer_base.BaseFix): - BM_compatible = True order = "pre" diff --git a/modernize/fixes/fix_filter.py b/modernize/fixes/fix_filter.py index f179c6a..5ad28ad 100644 --- a/modernize/fixes/fix_filter.py +++ b/modernize/fixes/fix_filter.py @@ -10,7 +10,6 @@ class FixFilter(fix_filter.FixFilter): - skip_on = "six.moves.filter" def transform(self, node, results): diff --git a/modernize/fixes/fix_import.py b/modernize/fixes/fix_import.py index 93c3dbe..e70a3ec 100644 --- a/modernize/fixes/fix_import.py +++ b/modernize/fixes/fix_import.py @@ -7,7 +7,6 @@ class FixImport(fix_import.FixImport): - # Make sure this runs before any other fixer to guarantee that any other # added absolute_import doesn't block this fixer's execution. run_order = 1 diff --git a/modernize/fixes/fix_imports_six.py b/modernize/fixes/fix_imports_six.py index 9015c0a..e89bb93 100644 --- a/modernize/fixes/fix_imports_six.py +++ b/modernize/fixes/fix_imports_six.py @@ -4,7 +4,6 @@ class FixImportsSix(fix_imports.FixImports): - mapping = { "__builtin__": "six.moves.builtins", "_winreg": "six.moves.winreg", diff --git a/modernize/fixes/fix_input_six.py b/modernize/fixes/fix_input_six.py index b52c692..01f7f18 100644 --- a/modernize/fixes/fix_input_six.py +++ b/modernize/fixes/fix_input_six.py @@ -15,7 +15,6 @@ class FixInputSix(fixer_base.ConditionalFix): - BM_compatible = True order = "pre" skip_on = "six.moves.input" diff --git a/modernize/fixes/fix_int_long_tuple.py b/modernize/fixes/fix_int_long_tuple.py index 058bbf5..43094c1 100644 --- a/modernize/fixes/fix_int_long_tuple.py +++ b/modernize/fixes/fix_int_long_tuple.py @@ -4,7 +4,6 @@ class FixIntLongTuple(fixer_base.BaseFix): - run_order = 4 # Must run before fix_long. PATTERN = """ diff --git a/modernize/fixes/fix_map.py b/modernize/fixes/fix_map.py index 08c5ca9..329949a 100644 --- a/modernize/fixes/fix_map.py +++ b/modernize/fixes/fix_map.py @@ -10,7 +10,6 @@ class FixMap(fix_map.FixMap): - skip_on = "six.moves.map" def transform(self, node, results): diff --git a/modernize/fixes/fix_open.py b/modernize/fixes/fix_open.py index 4673226..f7ba792 100644 --- a/modernize/fixes/fix_open.py +++ b/modernize/fixes/fix_open.py @@ -4,7 +4,6 @@ class FixOpen(fixer_base.BaseFix): - BM_compatible = True # Fixers don't directly stack, so make sure the 'file' case is covered. PATTERN = """ diff --git a/modernize/fixes/fix_raise_six.py b/modernize/fixes/fix_raise_six.py index 54f4f7a..a991db7 100644 --- a/modernize/fixes/fix_raise_six.py +++ b/modernize/fixes/fix_raise_six.py @@ -12,7 +12,6 @@ class FixRaiseSix(fixer_base.BaseFix): - BM_compatible = True PATTERN = """ raise_stmt< 'raise' exc=any ',' val=any ',' tb=any > diff --git a/modernize/fixes/fix_xrange_six.py b/modernize/fixes/fix_xrange_six.py index 1e308cd..ec7b6c9 100644 --- a/modernize/fixes/fix_xrange_six.py +++ b/modernize/fixes/fix_xrange_six.py @@ -8,7 +8,6 @@ class FixXrangeSix(fixer_base.ConditionalFix, fix_xrange.FixXrange): - skip_on = "six.moves.range" def transform(self, node, results): diff --git a/modernize/fixes/fix_zip.py b/modernize/fixes/fix_zip.py index 58bb66c..38d07ce 100644 --- a/modernize/fixes/fix_zip.py +++ b/modernize/fixes/fix_zip.py @@ -8,7 +8,6 @@ class FixZip(fix_zip.FixZip): - skip_on = "six.moves.zip" def transform(self, node, results): diff --git a/modernize/utils.py b/modernize/utils.py index 2d1921c..50efd64 100644 --- a/modernize/utils.py +++ b/modernize/utils.py @@ -51,7 +51,6 @@ def _check_future_import(node): def add_future(node, symbol): - root = fixer_util.find_root(node) for idx, node in enumerate(root.children): 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):