Skip to content

Commit 536b91a

Browse files
sebixaaronkaplan
authored andcommitted
Upgrade code with pyupgrade --py39-plus
1 parent cb0ab55 commit 536b91a

File tree

24 files changed

+52
-60
lines changed

24 files changed

+52
-60
lines changed

intelmq/bots/collectors/mail/collector_mail_body.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"""
77
Uses the common mail iteration method from the lib file.
88
"""
9-
from typing import Union, Iterable
9+
from typing import Union
10+
from collections.abc import Iterable
1011

1112
from ._lib import MailCollectorBot
1213

intelmq/bots/collectors/shodan/collector_stream.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
class ShodanStreamCollectorBot(CollectorBot):
3131
"Collect the Shodan stream from the Shodan API"
3232
api_key: str = "<INSERT your API key>"
33-
countries: List[str] = []
33+
countries: list[str] = []
3434
alert: Optional[str] = None
3535

3636
def init(self):

intelmq/bots/experts/gethostbyname/expert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
class GethostbynameExpertBot(ExpertBot):
3434
"""Resolve the IP address for the FQDN"""
3535
fallback_to_url: bool = True
36-
gaierrors_to_ignore: Tuple[int] = ()
36+
gaierrors_to_ignore: tuple[int] = ()
3737
overwrite: bool = False
3838

3939
def init(self):

intelmq/bots/experts/http/expert_status.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class HttpStatusExpertBot(ExpertBot):
2424
Specifies if an existing 'status' value should be overwritten.
2525
"""
2626
field: str = "source.url" # The field containing the URL
27-
success_status_codes: List[int] = [] # A list of status codes for success
27+
success_status_codes: list[int] = [] # A list of status codes for success
2828
overwrite: bool = True
2929

3030
def process(self):

intelmq/bots/experts/jinja/expert.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class JinjaExpertBot(ExpertBot):
2727
extra.somejinjaoutput: file:///etc/intelmq/somejinjatemplate.j2
2828
"""
2929

30-
fields: Dict[str, str] = {}
31-
_templates: Dict[str, Union[str, Template]] = {}
30+
fields: dict[str, str] = {}
31+
_templates: dict[str, Union[str, Template]] = {}
3232
overwrite: bool = False
3333

3434
def init(self):

intelmq/bots/experts/sieve/expert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def process(self) -> None:
173173

174174
_date_op_map = {":before": operator.lt, ":after": operator.gt}
175175

176-
_cond_map: Dict[
176+
_cond_map: dict[
177177
str,
178178
Callable[
179179
[

intelmq/bots/experts/threshold/expert.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
messages seen (which will be the threshold value).
4545
4646
"""
47-
from typing import Iterable, Optional
47+
from typing import Optional
48+
from collections.abc import Iterable
4849

4950
from intelmq.lib.bot import ExpertBot
5051
from intelmq.lib.exceptions import ConfigurationError

intelmq/bots/experts/url/expert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class URLExpertBot(ExpertBot):
6666
"""
6767

6868
overwrite: bool = False
69-
skip_fields: Optional[List[str]] = None
69+
skip_fields: Optional[list[str]] = None
7070

7171
def init(self):
7272
if self.skip_fields is None:

intelmq/bots/experts/url2fqdn/expert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def init(self):
2121
warnings.warn(DEPRECATION_WARNING, DeprecationWarning)
2222

2323
@staticmethod
24-
def check(parameters: dict) -> Optional[List[List[str]]]:
24+
def check(parameters: dict) -> Optional[list[list[str]]]:
2525
return [["warning", DEPRECATION_WARNING]]
2626

2727
def process(self):

intelmq/bots/outputs/cif3/output.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class CIF3OutputBot(OutputBot):
8383
add_feed_provider_as_tag: bool = False
8484
cif3_feed_confidence: float = 5
8585
cif3_static_confidence: bool = False
86-
cif3_additional_tags: List[str] = []
86+
cif3_additional_tags: list[str] = []
8787
cif3_token: Optional[str] = None
8888
cif3_url: Optional[str] = None
8989
fireball: int = 500

0 commit comments

Comments
 (0)