diff options
author | Florian Bruhin <me@the-compiler.org> | 2023-06-26 14:31:55 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2023-06-26 14:39:54 +0200 |
commit | 5fa878c7d190ba227aa05ab01385e640fc7ff42b (patch) | |
tree | b08153e2beb6b798066ee458371cf679e8a7ede9 /tests/end2end/conftest.py | |
parent | 93c7fdd60c0f1f0d26415525914fdca997b06c42 (diff) | |
download | qutebrowser-drop-py37.tar.gz qutebrowser-drop-py37.zip |
py38: Run modified pyupgradedrop-py37
Modified to leave f-strings alone for now, and also not do some other
stuff we should do separately:
diff --git i/pyupgrade/_main.py w/pyupgrade/_main.py
index 4292174..37547b3 100644
--- i/pyupgrade/_main.py
+++ w/pyupgrade/_main.py
@@ -294,7 +294,8 @@ def _fix_tokens(contents_text: str) -> str:
token.utf8_byte_offset == 0 and
token.line < 3 and
token.name == 'COMMENT' and
- tokenize.cookie_re.match(token.src)
+ tokenize.cookie_re.match(token.src) and
+ False
):
del tokens[i]
assert tokens[i].name == 'NL', tokens[i].name
diff --git i/pyupgrade/_plugins/fstrings.py w/pyupgrade/_plugins/fstrings.py
index e648075..eb44c0c 100644
--- i/pyupgrade/_plugins/fstrings.py
+++ w/pyupgrade/_plugins/fstrings.py
@@ -88,7 +88,7 @@ def _format_params(call: ast.Call) -> set[str]:
return params
-@register(ast.Call)
+# @register(ast.Call)
def visit_Call(
state: State,
node: ast.Call,
diff --git i/pyupgrade/_plugins/open_mode.py w/pyupgrade/_plugins/open_mode.py
index a20b95c..0388781 100644
--- i/pyupgrade/_plugins/open_mode.py
+++ w/pyupgrade/_plugins/open_mode.py
@@ -28,7 +28,7 @@ def _permute(*args: str) -> tuple[str, ...]:
return tuple(''.join(p) for s in args for p in itertools.permutations(s))
-MODE_REMOVE = frozenset(_permute('U', 'r', 'rU', 'rt'))
+MODE_REMOVE = frozenset(_permute('U', 'rU', 'rt'))
MODE_REPLACE_R = frozenset(_permute('Ub'))
MODE_REMOVE_T = frozenset(_plus(_permute('at', 'rt', 'wt', 'xt')))
MODE_REMOVE_U = frozenset(_permute('rUb'))
Then run with:
git ls-files | grep -E '(\.py|misc/userscripts)' | xargs ~/tmp/pyupgrade/.venv/bin/pyupgrade --py38-plus
And manually reverted some changes (e.g. it picking up bash userscripts)
Diffstat (limited to 'tests/end2end/conftest.py')
-rw-r--r-- | tests/end2end/conftest.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/end2end/conftest.py b/tests/end2end/conftest.py index bdc172857..febe1b70b 100644 --- a/tests/end2end/conftest.py +++ b/tests/end2end/conftest.py @@ -69,7 +69,7 @@ def _check_version(op_str, running_version, version_str, as_hex=False): '<': operator.lt, } op = operators[op_str] - major, minor, patch = [int(e) for e in version_str.split('.')] + major, minor, patch = (int(e) for e in version_str.split('.')) if as_hex: version = (major << 16) | (minor << 8) | patch else: |