Skip to content

Commit 84071c9

Browse files
Merge pull request steam-bell-92#938 from kumudasrip/fix/fibonacci-bare-except
Fix: Replace bare except with specific handlers in Fibonacci-Series.py
2 parents 81a1881 + fb1f139 commit 84071c9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

math/Fibonacci-Series/Fibonacci-Series.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,10 @@ def main() -> None:
194194
if screen_initialized and screen is not None:
195195
try:
196196
screen.bye()
197-
except:
198-
pass
197+
except turtle.Terminator:
198+
pass # Expected termination when window is closed
199+
except Exception as e:
200+
print(f"⚠️ Error closing turtle screen: {e}")
199201
break
200202

201203
if __name__ == "__main__":

0 commit comments

Comments
 (0)