Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 9, 2023
1 parent 1bcde55 commit aae2bf5
Show file tree
Hide file tree
Showing 15 changed files with 4 additions and 16 deletions.
1 change: 0 additions & 1 deletion modernize/fixes/fix_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class FixFile(fixer_base.BaseFix):

BM_compatible = True
order = "pre"

Expand Down
1 change: 0 additions & 1 deletion modernize/fixes/fix_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


class FixFilter(fix_filter.FixFilter):

skip_on = "six.moves.filter"

def transform(self, node, results):
Expand Down
1 change: 0 additions & 1 deletion modernize/fixes/fix_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion modernize/fixes/fix_imports_six.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class FixImportsSix(fix_imports.FixImports):

mapping = {
"__builtin__": "six.moves.builtins",
"_winreg": "six.moves.winreg",
Expand Down
1 change: 0 additions & 1 deletion modernize/fixes/fix_input_six.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@


class FixInputSix(fixer_base.ConditionalFix):

BM_compatible = True
order = "pre"
skip_on = "six.moves.input"
Expand Down
1 change: 0 additions & 1 deletion modernize/fixes/fix_int_long_tuple.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class FixIntLongTuple(fixer_base.BaseFix):

run_order = 4 # Must run before fix_long.

PATTERN = """
Expand Down
1 change: 0 additions & 1 deletion modernize/fixes/fix_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


class FixMap(fix_map.FixMap):

skip_on = "six.moves.map"

def transform(self, node, results):
Expand Down
1 change: 0 additions & 1 deletion modernize/fixes/fix_open.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = """
Expand Down
1 change: 0 additions & 1 deletion modernize/fixes/fix_raise_six.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@


class FixRaiseSix(fixer_base.BaseFix):

BM_compatible = True
PATTERN = """
raise_stmt< 'raise' exc=any ',' val=any ',' tb=any >
Expand Down
1 change: 0 additions & 1 deletion modernize/fixes/fix_xrange_six.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class FixXrangeSix(fixer_base.ConditionalFix, fix_xrange.FixXrange):

skip_on = "six.moves.range"

def transform(self, node, results):
Expand Down
1 change: 0 additions & 1 deletion modernize/fixes/fix_zip.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class FixZip(fix_zip.FixZip):

skip_on = "six.moves.zip"

def transform(self, node, results):
Expand Down
1 change: 0 additions & 1 deletion modernize/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_fix_imports_six.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import unittest

try:
from six.moves import tkinter
import tkinter
except ImportError:
tkinter = None

Expand Down
4 changes: 2 additions & 2 deletions tests/test_future_behaviour.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit aae2bf5

Please sign in to comment.