From 2e4f1629fd06d454c0ca40ac8572feb1c2441717 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bonhomme?= Date: Sun, 20 Nov 2022 00:15:25 +0100 Subject: [PATCH] fix: [mypy] Addressed mypy errors. --- stegano/lsb/lsb.py | 4 ++-- tests/test_lsb.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/stegano/lsb/lsb.py b/stegano/lsb/lsb.py index 6dc670d..9dc776f 100644 --- a/stegano/lsb/lsb.py +++ b/stegano/lsb/lsb.py @@ -34,7 +34,7 @@ from stegano import tools def hide( image: Union[str, IO[bytes]], message: str, - generator: Iterator[int] = None, + generator: Union[None, Iterator[int]] = None, shift: int = 0, encoding: str = "UTF-8", auto_convert_rgb: bool = False, @@ -65,7 +65,7 @@ def hide( def reveal( encoded_image: Union[str, IO[bytes]], - generator: Iterator[int] = None, + generator: Union[None, Iterator[int]] = None, shift: int = 0, encoding: str = "UTF-8", ): diff --git a/tests/test_lsb.py b/tests/test_lsb.py index 998c798..9355b7c 100644 --- a/tests/test_lsb.py +++ b/tests/test_lsb.py @@ -229,7 +229,7 @@ class TestLSB(unittest.TestCase): lsb.hide( "./tests/sample-files/Lenna.png", message_to_hide, - generators.unknown_generator(), + generators.unknown_generator(), # type: ignore ) def tearDown(self):