Skip to content

Commit 2a224ff

Browse files
committed
style: Make bandit ♥
1 parent 31a47cd commit 2a224ff

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

glv/providers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ def authorization(self) -> Optional[Tuple[str, str]]:
9090
try:
9191
auth_store = netrc.netrc()
9292
auth_tupple = auth_store.authenticators(self._url.host)
93-
except netrc.NetrcParseError as e:
94-
print(str(e), file=sys.stderr)
93+
except netrc.NetrcParseError as exc:
94+
print(str(exc), file=sys.stderr)
9595
auth_tupple = None
9696
except FileNotFoundError:
9797
auth_tupple = None
@@ -137,7 +137,7 @@ def enabled(repo) -> bool:
137137
_url = repo.remotes['origin'].url
138138
url = urllib3.util.parse_url(_url)
139139
result = url.hostname == 'github.com'
140-
except Exception: # pylint: disable=broad-except
140+
except Exception: # nosec pylint: disable=broad-except
141141
pass
142142
LOG.debug('github-api: enabled %s', result)
143143
return result
@@ -218,7 +218,7 @@ def enabled(repo) -> bool:
218218
if repo.remotes:
219219
url = urllib3.util.parse_url(repo.remotes['origin'].url)
220220
return url.hostname.startswith('bitbucket')
221-
except Exception: # pylint: disable=broad-except
221+
except Exception: # nosec pylint: disable=broad-except
222222
pass
223223
return False
224224

glv/vcs/__init__.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import logging
2424
import os
2525
import os.path
26-
import subprocess
26+
import subprocess # nosec
2727
from typing import Dict, List, Set
2828

2929
import xdg
@@ -140,11 +140,12 @@ def fetch_missing_data(commit: Commit, repo: Repository) -> bool:
140140
LOG.info('Fetching missisng data for %s', oid)
141141
LOG.debug('Executing %s', ' '.join(cmd))
142142
try:
143-
subprocess.run(cmd,
144-
capture_output=False,
145-
stdout=subprocess.DEVNULL,
146-
stderr=subprocess.DEVNULL,
147-
check=True)
143+
subprocess.run( # nosec
144+
cmd,
145+
capture_output=False,
146+
stdout=subprocess.DEVNULL,
147+
stderr=subprocess.DEVNULL,
148+
check=True)
148149
except subprocess.CalledProcessError:
149150
return False
150151
return True

0 commit comments

Comments
 (0)