Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion digital_image_processing/filters/local_binary_pattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def get_neighbors_pixel(

try:
return int(image[x_coordinate][y_coordinate] >= center)
except (IndexError, TypeError):
except IndexError, TypeError:
Copy link
Member

@cclauss cclauss Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You must be using Python < 3.14, but this repo ALWAYS uses the latest current Python.

Also, please make sure that you are using the latest version of ruff.

return 0


Expand Down
2 changes: 1 addition & 1 deletion divide_and_conquer/convex_hull.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def _construct_points(
else:
try:
points.append(Point(p[0], p[1]))
except (IndexError, TypeError):
except IndexError, TypeError:
print(
f"Ignoring deformed point {p}. All points"
" must have at least 2 coordinates."
Expand Down
2 changes: 1 addition & 1 deletion dynamic_programming/catalan_numbers.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def catalan_numbers(upper_limit: int) -> "list[int]":
print(f"The Catalan numbers from 0 through {N} are:")
print(catalan_numbers(N))
print("Try another upper limit for the sequence: ", end="")
except (NameError, ValueError):
except NameError, ValueError:
print("\n********* Invalid input, goodbye! ************\n")

import doctest
Expand Down
2 changes: 1 addition & 1 deletion maths/greatest_common_divisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def main():
f"{greatest_common_divisor(num_1, num_2)}"
)
print(f"By iterative gcd({num_1}, {num_2}) = {gcd_by_iterative(num_1, num_2)}")
except (IndexError, UnboundLocalError, ValueError):
except IndexError, UnboundLocalError, ValueError:
print("Wrong input")


Expand Down
2 changes: 1 addition & 1 deletion project_euler/problem_002/sol4.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def solution(n: int = 4000000) -> int:

try:
n = int(n)
except (TypeError, ValueError):
except TypeError, ValueError:
raise TypeError("Parameter n must be int or castable to int.")
if n <= 0:
raise ValueError("Parameter n must be greater than or equal to one.")
Expand Down
2 changes: 1 addition & 1 deletion project_euler/problem_003/sol1.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def solution(n: int = 600851475143) -> int:

try:
n = int(n)
except (TypeError, ValueError):
except TypeError, ValueError:
raise TypeError("Parameter n must be int or castable to int.")
if n <= 0:
raise ValueError("Parameter n must be greater than or equal to one.")
Expand Down
2 changes: 1 addition & 1 deletion project_euler/problem_003/sol2.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def solution(n: int = 600851475143) -> int:

try:
n = int(n)
except (TypeError, ValueError):
except TypeError, ValueError:
raise TypeError("Parameter n must be int or castable to int.")
if n <= 0:
raise ValueError("Parameter n must be greater than or equal to one.")
Expand Down
2 changes: 1 addition & 1 deletion project_euler/problem_003/sol3.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def solution(n: int = 600851475143) -> int:

try:
n = int(n)
except (TypeError, ValueError):
except TypeError, ValueError:
raise TypeError("Parameter n must be int or castable to int.")
if n <= 0:
raise ValueError("Parameter n must be greater than or equal to one.")
Expand Down
2 changes: 1 addition & 1 deletion project_euler/problem_005/sol1.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def solution(n: int = 20) -> int:

try:
n = int(n)
except (TypeError, ValueError):
except TypeError, ValueError:
raise TypeError("Parameter n must be int or castable to int.")
if n <= 0:
raise ValueError("Parameter n must be greater than or equal to one.")
Expand Down
2 changes: 1 addition & 1 deletion project_euler/problem_007/sol2.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def solution(nth: int = 10001) -> int:

try:
nth = int(nth)
except (TypeError, ValueError):
except TypeError, ValueError:
raise TypeError("Parameter nth must be int or castable to int.") from None
if nth <= 0:
raise ValueError("Parameter nth must be greater than or equal to one.")
Expand Down
Loading
Loading