Kanika Kapoor c048ec9faf Fix context manager __exit__ not being called on exception (#395)
Problem: When an exception occurs in a WITH block, __exit__ was not called,
preventing proper cleanup of context managers.

Solution:
1. Wrap WITH block body in try-except structure
2. On normal exit: call __exit__(None, None, None)
3. On exception: call __exit__ with exception info before re-raising

Changes:
- compiler.c: Wrap WITH body in try-except, ensure __exit__ called in both paths
- ceval.c: Update OP_WITH_EXIT to accept three arguments (exc_type, exc_val, exc_tb)
- tests/520_context.py: Add test to verify __exit__ called on exceptions
2025-12-27 01:12:15 +05:30
..
...
2023-08-28 13:17:58 +08:00
...
2024-08-13 10:41:12 +08:00
...
2023-08-28 13:40:39 +08:00
2025-06-22 16:31:46 +08:00
2025-12-04 21:01:29 +08:00
2025-12-19 16:36:43 +08:00
2025-12-09 13:43:33 +08:00
2025-12-04 21:01:29 +08:00
2025-12-25 18:12:04 +08:00
2025-12-04 21:01:29 +08:00
2025-12-04 21:01:29 +08:00
2025-12-04 21:01:29 +08:00
2025-12-04 21:01:29 +08:00
2025-12-16 17:10:45 +08:00
2025-12-04 21:01:29 +08:00
2025-12-04 21:01:29 +08:00