FIX: Make 02 flake8 complient

This commit is contained in:
2026-02-02 14:41:10 +01:00
parent 7e3ca26e97
commit eab1167091
5 changed files with 35 additions and 22 deletions

View File

@@ -1,7 +1,7 @@
def water_plants(plant_list: list[str | None]) -> None:
"""Display watering plant if plant is a string"""
for plant in plant_list:
if plant == None:
if not plant:
raise ValueError
print("Watering", plant)
@@ -14,7 +14,7 @@ def test_watering_system() -> None:
try:
print("Opening watering system")
water_plants(plants)
except:
except ValueError:
print("Error: Cannot water None - invalid plant!")
finally:
print("Closing watering system (cleanup)")