Skip to content

Commit d65b400

Browse files
committed
Run pyupgrade with --py37-plus
Fix two places to be py37+ style.
1 parent c792cb0 commit d65b400

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

.github/workflows/python-package.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ jobs:
109109
from pyupgrade._main import main
110110
from glob import glob
111111
files = glob('**/*.py', recursive=True)
112-
main(files + ['--py36-plus'])
112+
main(files + ['--py37-plus'])
113113
"
114114
- name: Check dependencies for known security vulterabilities using Safety
115115
run: safety check

release_tools/update_contributors.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from itertools import groupby
2020
from pathlib import Path
2121
from textwrap import dedent, indent
22-
from typing import Any, Dict, Iterable, List, MutableMapping, Optional, Text, cast
22+
from typing import Any, Dict, Iterable, List, MutableMapping, Optional, cast
2323

2424
import click
2525
import defusedxml.ElementTree
@@ -175,7 +175,7 @@ def request( # type: ignore[override] # pylint: disable=arguments-differ
175175
self,
176176
method: str,
177177
url: str,
178-
headers: MutableMapping[Text, Text] = None,
178+
headers: MutableMapping[str, str] = None,
179179
**kwargs: Any,
180180
) -> Response:
181181
"""Query GitHub API with authorization, caching and host auto-fill-in

src/darker/tests/helpers.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,14 @@
22

33
import re
44
import sys
5-
from contextlib import contextmanager
5+
from contextlib import contextmanager, nullcontext
66
from types import ModuleType
77
from typing import Any, ContextManager, Dict, List, Optional, Union
88
from unittest.mock import patch
99

1010
import pytest
1111
from _pytest.python_api import RaisesContext
1212

13-
if sys.version_info >= (3, 7):
14-
from contextlib import nullcontext
15-
else:
16-
from contextlib import suppress as nullcontext
17-
1813

1914
def filter_dict(dct: Dict[str, Any], filter_key: str) -> Dict[str, Any]:
2015
"""Return only given keys with their values from a dictionary"""

0 commit comments

Comments
 (0)