Skip to content

Commit b4c25fe

Browse files
committed
Linting
1 parent b887d70 commit b4c25fe

File tree

4 files changed

+10
-25
lines changed

4 files changed

+10
-25
lines changed

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
include __pkginfo__.py
22
include LICENSE
33
include requirements.txt
4-
recursive-exclude **/__pycache__ *
4+
prune **/__pycache__
55
recursive-include domdf_python_tools *.pyi
66
include domdf_python_tools/py.typed

domdf_python_tools/terminal.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def _get_terminal_size_windows() -> Optional[Tuple[int, int]]: # pragma: no cov
185185
size_y = bottom - top + 1
186186

187187
return size_x, size_y
188-
except:
188+
except Exception:
189189
pass
190190

191191
return None
@@ -198,7 +198,7 @@ def _get_terminal_size_tput() -> Optional[Tuple[int, int]]: # pragma: no cover
198198
cols = int(subprocess.check_call(shlex.split("tput cols")))
199199
rows = int(subprocess.check_call(shlex.split("tput lines")))
200200
return cols, rows
201-
except:
201+
except Exception:
202202
return None
203203

204204

@@ -212,7 +212,7 @@ def ioctl_GWINSZ(fd):
212212
try:
213213
cr = struct.unpack("hh", fcntl.ioctl(fd, termios.TIOCGWINSZ, "1234"))
214214
return cr
215-
except:
215+
except Exception:
216216
pass
217217

218218
cr = ioctl_GWINSZ(0) or ioctl_GWINSZ(1) or ioctl_GWINSZ(2)
@@ -222,13 +222,13 @@ def ioctl_GWINSZ(fd):
222222
fd = os.open(os.ctermid(), os.O_RDONLY) # type: ignore
223223
cr = ioctl_GWINSZ(fd)
224224
os.close(fd)
225-
except:
225+
except Exception:
226226
pass
227227

228228
if not cr:
229229
try:
230230
cr = (os.environ["LINES"], os.environ["COLUMNS"])
231-
except:
231+
except Exception:
232232
return None
233233

234234
return int(cr[1]), int(cr[0])

tests/test_units.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ def test_rmul_errors(self, obj):
4646
@pytest.mark.parametrize("obj", units_ints_zero2thousand)
4747
def test_pow_errors(self, obj):
4848
with pytest.raises(NotImplementedError, match="Powers are not supported for units."):
49-
Unit(17)**obj
49+
Unit(17)**obj # pylint: disable=expression-not-assigned
5050

5151
if isinstance(obj, Unit):
5252
with pytest.raises(NotImplementedError, match="Powers are not supported for units."):
53-
obj**Unit(17)
53+
obj**Unit(17) # pylint: disable=expression-not-assigned
5454

5555

5656
class TestDiv:
@@ -82,9 +82,9 @@ def test_floordiv_errors(self, obj):
8282
@pytest.mark.parametrize("obj", units_zero2thousand)
8383
def test_modulo_errors(self, obj):
8484
with pytest.raises(NotImplementedError, match="Modulo division of a unit by another unit is not allowed."):
85-
Unit(17) % obj
85+
Unit(17) % obj # pylint: disable=expression-not-assigned
8686
with pytest.raises(NotImplementedError, match="Modulo division of a unit by another unit is not allowed."):
87-
obj % Unit(17)
87+
obj % Unit(17) # pylint: disable=expression-not-assigned
8888

8989
@pytest.mark.parametrize("obj", one2thousand)
9090
def test_modulo(self, obj: int):

tox.ini

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -115,21 +115,6 @@ deps =
115115
commands = mypy domdf_python_tools tests
116116

117117

118-
[testenv:bandit]
119-
basepython = python3.6
120-
121-
ignore_errors = true
122-
changedir = {toxinidir}
123-
deps =
124-
bandit
125-
whitelist_externals = /usr/bin/printf
126-
commands =
127-
printf "===== Running Bandit on domdf_python_tools ====="
128-
bandit domdf_python_tools -r
129-
printf "===== Running Bandit on tests ====="
130-
bandit tests -r -s B101
131-
132-
133118
[testenv:pyup]
134119
basepython = python3.6
135120
skip_install = true

0 commit comments

Comments
 (0)