Skip to content

Commit 90f7b47

Browse files
Fixed a few anti-patterns.
1 parent 39a5fa2 commit 90f7b47

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

.deepsource.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ exclude_patterns = [
2222
".coveralls.yml",
2323
"codecov_env",
2424
"*,cover",
25-
".hypothesis/"
25+
".hypothesis/",
26+
"docs/"
2627
]
2728

2829
[[analyzers]]
@@ -39,4 +40,4 @@ dependency_file_paths = [
3940

4041
[[analyzers]]
4142
name = "test-coverage"
42-
enabled = true
43+
enabled = true

pythonrepo/pythonrepo.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,8 @@ def parseArgs(arguments=None):
9999

100100
def useTool(tool, *arguments):
101101
"""Handler for launching the functions."""
102-
if (tool is not None) and (tool in TASK_OPTIONS.keys()):
102+
if (tool is not None) and (tool in TASK_OPTIONS):
103103
try:
104-
# print(str("launching: " + tool))
105104
TASK_OPTIONS[tool](arguments)
106105
except Exception:
107106
w = str("WARNING - An error occured while")
@@ -123,13 +122,13 @@ def main(*argv):
123122
w += str("handling the arguments.")
124123
w += str(" Cascading failure.")
125124
print(w)
126-
exit(2)
125+
sys.exit(2)
127126
except Exception:
128127
e = str("CRITICAL - An error occured while handling")
129128
e += str("the cascading failure.")
130129
print(e)
131-
exit(3)
132-
exit(0)
130+
sys.exit(3)
131+
sys.exit(0)
133132

134133

135134
if __name__ in '__main__':

tests/profiling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,5 +268,5 @@ def main(*argv): # pragma: no cover
268268
try:
269269
exitcode = main(sys.argv[1:])
270270
finally:
271-
exit(exitcode)
271+
sys.exit(exitcode)
272272

0 commit comments

Comments
 (0)