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
blueloveTH
1e2135e153
discard '_'
2025-12-25 18:12:04 +08:00
blueloveTH
8ff3f44179
fix https://github.com/pocketpy/pocketpy/issues/394
2025-12-25 17:42:24 +08:00
blueloveTH
ecdea105d6
fix https://github.com/pocketpy/pocketpy/issues/408
2025-12-25 17:40:07 +08:00
blueloveTH
e23fd85ebd
add bin
2025-12-19 16:36:43 +08:00
blueloveTH
2eb84b562e
add stdc module
2025-12-16 17:10:45 +08:00
blueloveTH
6cad72453b
fix error of "A() takes no arguments"
2025-12-09 14:45:08 +08:00
blueloveTH
5c7fb79a14
support del slice for list
2025-12-09 13:43:33 +08:00
zhs628
fc991ab697
Increase coverage 2025 12 01 ( #412 )
...
* 通过引发py_call错误覆盖相关调用者的ok==false分支
* Revert "通过引发py_call错误覆盖相关调用者的ok==false分支"
This reverts commit 36dc0b5d81a02a83dfdeca2d4d6d265f5f793b4b.
* add test
* rename test files
* fix bugs
* fix bugs
2025-12-04 21:01:29 +08:00
blueloveTH
0b91c2968b
add picoterm.sscanf
2025-11-27 14:41:13 +08:00
blueloveTH
6f9b7943d4
add wcwidth and wcswidth
2025-11-27 11:31:14 +08:00
blueloveTH
bfe471dc12
small refactor
2025-11-24 11:41:37 +08:00
BLUELOVETH
c45a5df1e8
add setup_gc_debug_callback ( #406 )
...
* [no ci] backup
* [no ci] backup
* [no ci] fix
* [no ci] fix
* [no ci] fix
* [no ci] fix
* [no ci] fix
* [no ci] fix
* [no ci] fix
* [no ci] fix
---------
Co-authored-by: 张皓晟 <2067144018@qq.com>
2025-11-23 16:30:22 +08:00
blueloveTH
4827e6dea3
add picoterm module
2025-11-23 00:14:14 +08:00
blueloveTH
b0b3bdef86
fix some bug
2025-11-11 16:09:33 +08:00
Daniel Saier
e39e63191f
Add support for some missing escape sequences ( #399 )
2025-10-08 21:56:54 +08:00
blueloveTH
0251f924c3
fix leak and improve pickle
2025-10-08 21:09:14 +08:00
blueloveTH
c30a7adaff
add cpy11__float_div_mod
2025-09-29 11:24:41 +08:00
blueloveTH
354e8fc03f
support divmod for pos float
2025-09-28 19:31:47 +08:00
blueloveTH
50db32f36e
Update 25_rfstring.py
2025-09-17 14:19:48 +08:00
blueloveTH
62491dd99a
reimpl str.format
2025-09-17 14:10:26 +08:00
blueloveTH
f12a379760
add maxlen for deque
2025-09-08 20:07:54 +08:00
blueloveTH
1ab175006d
fix a bug of property
2025-08-31 13:35:25 +08:00
blueloveTH
6e9dd9516b
Update 28_exception.py
2025-08-31 01:52:18 +08:00
blueloveTH
4a81e975c8
fix a bug
2025-08-31 01:28:33 +08:00
blueloveTH
0b7f63ccaf
Update 28_exception.py
2025-08-31 00:13:54 +08:00
blueloveTH
c658b5a7a4
backup
2025-08-31 00:09:55 +08:00
blueloveTH
1d16d1a6f7
disable finally cuz it is buggy
2025-08-30 21:34:37 +08:00
blueloveTH
b57b16efaf
Update 28_exception.py
2025-08-29 23:47:51 +08:00
blueloveTH
5f265e5ec8
Revert "test new sweep algo"
...
This reverts commit 410a3c5dd42d577b9c31713ed0af673f29decfc2.
2025-08-29 23:43:21 +08:00
blueloveTH
410a3c5dd4
test new sweep algo
2025-08-29 23:35:39 +08:00
blueloveTH
648c1bedb4
[skip ci] add a bad case
2025-08-28 19:34:53 +08:00
blueloveTH
054fcba7e4
fix gc bug
2025-08-26 00:51:55 +08:00
blueloveTH
0c897df2c6
backup
2025-08-26 00:48:58 +08:00
blueloveTH
9a23eb6c9e
fix a bug
2025-08-26 00:32:22 +08:00
blueloveTH
0ce88fa70c
backup
2025-08-25 20:16:11 +08:00
blueloveTH
b7abcf19b1
remove trailing newline
2025-08-05 13:40:01 +08:00
blueloveTH
7016a8780c
use 24 bytes data
...
Update pocketpy.h
Update pocketpy.h
2025-07-13 23:55:45 +08:00
blueloveTH
81679b740e
fix https://github.com/pocketpy/pocketpy/issues/382
2025-07-12 21:11:12 +08:00
blueloveTH
ccd00e83a5
fix https://github.com/pocketpy/pocketpy/issues/336
2025-07-03 18:11:35 +08:00
blueloveTH
d5a511ad7c
fix https://github.com/pocketpy/pocketpy/issues/378
2025-07-03 18:04:36 +08:00
blueloveTH
a1e35b6e13
add PK_ENABLE_THREADS
2025-06-30 11:30:36 +08:00
blueloveTH
caf7505dc2
improve dict
2025-06-29 21:44:57 +08:00
blueloveTH
fd6f0d76b2
fix https://github.com/pocketpy/pocketpy/issues/376
2025-06-27 11:18:32 +08:00
blueloveTH
e187a61624
fix module reload bug
2025-06-22 16:31:46 +08:00
blueloveTH
68a2186728
improve module
2025-06-22 13:37:20 +08:00
blueloveTH
4fd47072fc
fix py_name2ref
...
Update vm.c
backup
2025-06-13 17:29:42 +08:00
blueloveTH
8ff60df158
Update 72_lz4.py
2025-05-29 19:11:15 +08:00
blueloveTH
a402406982
add float division by zero
2025-05-29 17:17:22 +08:00
PrimedErwin
0d40080d1f
add random hard encoded test case
2025-05-23 16:24:30 +08:00