mirror of
https://github.com/DavidGailleton/42-Piscine_Python.git
synced 2026-03-14 05:06:55 +01:00
FIX: Make 02 flake8 complient
This commit is contained in:
@@ -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)")
|
||||
|
||||
Reference in New Issue
Block a user