diff --git a/stegano/steganalysis/statistics.py b/stegano/steganalysis/statistics.py index b83ab31..985ecf1 100644 --- a/stegano/steganalysis/statistics.py +++ b/stegano/steganalysis/statistics.py @@ -25,6 +25,7 @@ __date__ = "$Date: 2010/10/01 $" __revision__ = "$Date: 2016/08/26 $" __license__ = "GPLv3" +import typing import operator from PIL import Image @@ -37,7 +38,7 @@ def steganalyse(img): """ encoded = img.copy() width, height = img.size - colours_counter = Counter() # type: Counter[int] + colours_counter = Counter() # type: typing.Counter[int] for row in range(height): for col in range(width): r, g, b = img.getpixel((col, row)) diff --git a/tools/run_mypy.py b/tools/run_mypy.py index c70e6da..7a1efc2 100644 --- a/tools/run_mypy.py +++ b/tools/run_mypy.py @@ -1,18 +1,21 @@ import subprocess import sys -modules = ["stegano/tools.py", - "stegano/lsb/lsb.py", - "stegano/lsbset/lsbset.py", - "stegano/lsbset/generators.py", - "stegano/red/red.py", - "stegano/exifHeader/exifHeader.py", - "stegano/steganalysis/parity.py", - "stegano/steganalysis/statistics.py"] +modules = ['stegano/tools.py', + 'stegano/lsb/lsb.py', + 'stegano/lsbset/lsbset.py', + 'stegano/lsbset/generators.py', + 'stegano/red/red.py', + 'stegano/exifHeader/exifHeader.py', + 'stegano/steganalysis/parity.py', + 'stegano/steganalysis/statistics.py'] exit_codes = [] for module in modules: - rc = subprocess.call(["mypy", "--ignore-missing-imports", - "--follow-imports", "skip", module]) + rc = subprocess.call(['mypy', '--ignore-missing-imports', + '--check-untyped-defs', + '--follow-imports', 'skip', module], + ) exit_codes.append(rc) + sys.exit(max(exit_codes))