Skip to content

Commit 7630183

Browse files
committed
chore: Run pre-commit to upgrade syntax for Python 3.10
1 parent 0603e2e commit 7630183

File tree

10 files changed

+79
-72
lines changed

10 files changed

+79
-72
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ repos:
1717
- id: "pyupgrade"
1818
name: "Auto-standardize python syntax"
1919
args:
20-
- "--py39-plus"
20+
- "--py310-plus"
2121
language: "python"
2222
verbose: true
2323

CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
- Summary:
77
- To be determined
88

9+
## Version: 0.8.53
10+
11+
- Summary:
12+
- Run pre-commit for python 3.10+
13+
914
## Version: 0.8.52
1015

1116
- Summary:

ciscoconfparse2/ccp_abc.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ def re_search_children(self, regex, recurse=False):
14451445
@logger.catch(reraise=True)
14461446
def re_match_typed(
14471447
self,
1448-
regex: Union[str, re.Pattern],
1448+
regex: str | re.Pattern,
14491449
group: int = 1,
14501450
result_type: type = str,
14511451
default: Any = "",
@@ -1527,7 +1527,7 @@ def re_match_typed(
15271527
@logger.catch(reraise=True)
15281528
def re_match_iter_typed(
15291529
self,
1530-
regex: Union[str, re.Pattern],
1530+
regex: str | re.Pattern,
15311531
group: int = 1,
15321532
result_type: type = str,
15331533
default: Any = "",
@@ -1715,7 +1715,7 @@ def re_match_iter_typed(
17151715
@logger.catch(reraise=True)
17161716
def re_list_iter_typed(
17171717
self,
1718-
regex: Union[str, re.Pattern],
1718+
regex: str | re.Pattern,
17191719
group: int = 1,
17201720
result_type: type = str,
17211721
groupdict: dict = None,
@@ -1822,7 +1822,7 @@ def re_list_iter_typed(
18221822
@logger.catch(reraise=True)
18231823
def re_list_iter_typed_groupdict_none(
18241824
self,
1825-
regex: Union[str, re.Pattern],
1825+
regex: str | re.Pattern,
18261826
group: int = 1,
18271827
result_type: type = str,
18281828
groupdict: dict = None,
@@ -1869,7 +1869,7 @@ def re_list_iter_typed_groupdict_none(
18691869
@logger.catch(reraise=True)
18701870
def re_list_iter_typed_groupdict_dict(
18711871
self,
1872-
regex: Union[str, re.Pattern],
1872+
regex: str | re.Pattern,
18731873
group: int = 1,
18741874
result_type: type = str,
18751875
groupdict: dict = None,

ciscoconfparse2/ccp_util.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
IPv6Network,
5050
)
5151
from ipaddress import collapse_addresses as ipaddr_collapse_addresses
52-
from typing import Any, Callable, Optional, Union
52+
from typing import Any, Optional, Union
53+
from collections.abc import Callable
5354

5455
import attrs
5556
from dns import query, reversename, zone
@@ -617,7 +618,7 @@ def ip_net(arg):
617618
@attrs.define(repr=False, slots=False)
618619
class IPv4Obj:
619620
dna: str = "IPv4Obj"
620-
v4input: Optional[Union[str, int]] = None
621+
v4input: str | int | None = None
621622
strict: bool = False
622623
debug: int = 0
623624

@@ -629,7 +630,7 @@ class IPv4Obj:
629630
# This method is on IPv4Obj(). @logger.catch() breaks the __init__() method.
630631
def __init__(
631632
self,
632-
v4input: Optional[Union[str, int]] = None,
633+
v4input: str | int | None = None,
633634
strict: bool = False,
634635
debug: int = 0,
635636
):
@@ -1444,7 +1445,7 @@ def is_reserved(self):
14441445
@attrs.define(repr=False, slots=False)
14451446
class IPv6Obj:
14461447
dna: str = "IPv6Obj"
1447-
v6input: Optional[Union[str, int]] = None
1448+
v6input: str | int | None = None
14481449
strict: bool = False
14491450
debug: int = 0
14501451

@@ -1458,7 +1459,7 @@ class IPv6Obj:
14581459
# This method is on IPv6Obj(). @logger.catch() breaks the __init__() method.
14591460
def __init__(
14601461
self,
1461-
v6input: Optional[Union[str, int]] = None,
1462+
v6input: str | int | None = None,
14621463
strict: bool = False,
14631464
debug: int = 0,
14641465
):
@@ -4905,8 +4906,8 @@ class CiscoRange(UserList):
49054906
result_type: Callable = None
49064907
default_iter_attr: str = None
49074908
reverse: bool = None
4908-
begin_obj: Union[CiscoIOSInterface, CiscoIOSXRInterface] = None
4909-
this_obj: Union[CiscoIOSInterface, CiscoIOSXRInterface] = None
4909+
begin_obj: CiscoIOSInterface | CiscoIOSXRInterface = None
4910+
this_obj: CiscoIOSInterface | CiscoIOSXRInterface = None
49104911
iterate_attribute: int = None
49114912
range_str: str = None
49124913
"""Explode Cisco ranges into a list of explicit items... examples below...

0 commit comments

Comments
 (0)