Skip to content

Commit a6dcaa5

Browse files
committed
fix issues reported by mypy
1 parent a87de84 commit a6dcaa5

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

src/exabgp/application/healthcheck.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def loopback_ips(label, label_only, label_exact_match):
202202
)
203203
cmd = subprocess.Popen('/sbin/ifconfig lo0'.split(), shell=False, stdout=subprocess.PIPE)
204204
labelre = re.compile(r'')
205-
for line in (cmd.stdout or []):
205+
for line in cmd.stdout or []:
206206
line = line.decode('ascii', 'ignore').strip()
207207
mo = ipre.match(line)
208208
if not mo:

src/exabgp/bgp/message/update/nlri/qualifier/path.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414

1515
class PathInfo(object):
16+
NOPATH: 'PathInfo | None' = None
17+
1618
def __init__(self, packed=None, integer=None, ip=None):
1719
if packed:
1820
self.path_info = packed

src/exabgp/cli/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ class msg(dict):
33
help = '[help]'
44
validation = '[validation]'
55

6-
keys = [command, help, validation]
6+
_keys = [command, help, validation]
77

88
def __init__(self):
99
self[self.help] = ''
1010
self[self.command] = ''
1111
self[self.validation] = ''
1212

1313
def __str__(self):
14-
return ' '.join(f'{k}:{self[k]}' for k in self.keys if self[k])
14+
return ' '.join(f'{k}:{self[k]}' for k in self._keys if self[k])

src/exabgp/netlink/sequence.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
class Sequence(int):
12-
_instance = dict()
12+
_instance: dict[str, int] = dict()
1313

1414
def __new__(cls):
1515
cls._instance['next'] = cls._instance.get('next', 0) + 1

src/exabgp/reactor/api/command/command.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010

1111
class Command(object):
12-
callback = {'text': {}, 'json': {}, 'neighbor': {}, 'options': {}}
12+
callback: dict[str, dict] = {'text': {}, 'json': {}, 'neighbor': {}, 'options': {}}
1313

14-
functions = []
14+
functions: list[str] = []
1515

1616
@classmethod
1717
def register(cls, name, neighbor=True, options=None, json_support=False):

0 commit comments

Comments
 (0)