From 4a7b0cc000a9f5370e7f4dc002402448abc5ff6e Mon Sep 17 00:00:00 2001 From: Alek Ratzloff Date: Tue, 4 Jun 2024 22:05:17 -0700 Subject: [PATCH] Fix mypy checking Signed-off-by: Alek Ratzloff --- colorhash/matricizer.py | 4 +++ examples/commithash.svg | 80 ++++++++++++++++++++--------------------- 2 files changed, 44 insertions(+), 40 deletions(-) diff --git a/colorhash/matricizer.py b/colorhash/matricizer.py index ce9a1b1..d3186b0 100644 --- a/colorhash/matricizer.py +++ b/colorhash/matricizer.py @@ -87,6 +87,8 @@ class NibbleMatricizer(Matricizer): """ algo = detect_hash_algorithm(data) + if algo is None: + raise ValueError("unable to determine hash algorithm") w, h = self.DIMENSIONS[algo] nibbles = [] @@ -152,6 +154,8 @@ class RandomartMatricizer(Matricizer): :returns: the matrix converted from the hash data. """ algo = detect_hash_algorithm(data) + if algo is None: + raise ValueError("unable to determine hash algorithm") w, h = self.DIMENSIONS[algo] rows = [[0] * w for _ in range(h)] diff --git a/examples/commithash.svg b/examples/commithash.svg index debd3f4..64b9870 100644 --- a/examples/commithash.svg +++ b/examples/commithash.svg @@ -1,42 +1,42 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file