Commit Graph

23 Commits

Author SHA1 Message Date
Lee Dogeon
e7d2b57dcc Match __module__ setter behavior to CPython (#7424)
* Remove stale __firstlineno__ when updating type.__module__

* Register and use __firstlineno__ as identifier
2026-03-14 15:48:48 +09:00
Jeong, YunWon
ccd377cc47 instruction CACHE (#7251)
* Emit CACHE code units in bytecode to match CPython 3.14

- Add cache_entries() method to Instruction enum
- Emit CACHE code units after opcodes in finalize_code
- Handle NO_LOCATION (line=-1) in linetable for CACHE entries
- Account for CACHE entries in exception table generation
- Skip CACHE entries in VM execution loop (with jump detection)
- Handle CACHE in InstrumentedLine/InstrumentedInstruction/InstrumentedForIter/InstrumentedNotTaken
- Skip CACHE in monitoring instrumentation phases
- Update co_branches() for cache-adjusted offsets
- Restore _cache_format in Lib/opcode.py
- Remove expectedFailure from test_c_call, test_start_offset

* Use relative jump offsets and fix bytecode layout

- Convert jump arguments from absolute to relative offsets
  in frame.rs, monitoring.rs, and stack_analysis
- Add jump_relative_forward/backward helpers to ExecutingFrame
- Resolve pseudo jump instructions before offset fixpoint loop
- Emit NOP for break, continue, pass to match line-tracing
- Fix async for: emit EndAsyncFor with correct target, add NotTaken
- Fix comprehension if-cleanup to use separate block
- Fix super() source range for multi-line calls
- Fix NOP removal to preserve line-marker NOPs
- Fix InstrumentedLine cache skipping after re-dispatch
- Match InstrumentedResume/YieldValue in yield_from_target
- Remove CALL_FUNCTION_EX cache entry from opcode.py
- Remove resolved expectedFailure markers

* Align CPython 3.14 LOAD_GLOBAL null-bit and RERAISE semantics

* Remove redundant CPython-referencing comments

Clean up comments that unnecessarily mention CPython per project
convention. Replace with concise descriptions of the behavior itself.
2026-03-01 14:51:54 +09:00
Jeong, YunWon
6950baf687 more algorithm-independent GC infra (#7194)
* mark poluting tests

* GC-infra independent to EBR

* trashcan

* add overflow guard to inc(), #[must_use] on dec()/safe_inc(), trashcan debug_assert, weakref generic re-check
2026-02-22 21:31:42 +09:00
Lee Dogeon
3d33bea285 Remove expectedFailure from test_types_coroutine_wrapper_state
The types.py upgrade added gi_suspended to _GeneratorWrapper,
fixing this test.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 18:39:56 +09:00
CPython Developers
1f290dccfe Update hashlib from v3.14.3 2026-02-14 21:40:04 +09:00
CPython Developers
b6d08fe371 Update test_unpack_ex from v3.14.2 2026-02-12 01:01:35 +09:00
Jeong, YunWon
ad6e965ad3 apply tests 2026-02-11 16:50:23 +09:00
Shahar Naveh
3d283bb91f Update some libs&tests to 3.14.3 (#7006)
* Update some libs&tests to 3.14.3

* Update argparse from 3.14.3

* Update inspect

* Update `configparser.py` from 3.14.3
2026-02-07 19:09:42 +09:00
Jeong, YunWon
6b870d62ad Fix traceback, syntax errors, and exception handling (#7015)
* Update codeop from v3.14.3

* Fix traceback, syntax errors, and exception handling

- Improve unclosed bracket detection with "'(' was never closed" message
- Fix IndentationError location to point to end of line
- Implement frame.clear() with proper checks for executing/suspended frames
- Fix exception context chaining for propagated exceptions
- Add traceback.__dir__() and prevent tb_next deletion
- Fix subscript operation source range restoration in compiler
- Change "duplicate parameter" to "duplicate argument" error message
- Refactor duplicate code in asyncgenerator.rs and frame.rs

---------

Co-authored-by: CPython Developers <>
2026-02-07 13:41:45 +09:00
Jeong, YunWon
cdadde55ef Update faulthandler to match CPython 3.14.2
- Rewrite faulthandler with live frame walking via
  Frame.previous AtomicPtr chain and thread-local
  CURRENT_FRAME (AtomicPtr) instead of frame snapshots
- Add signal-safe traceback dumping (dump_live_frames,
  dump_frame_from_raw) walking the Frame.previous chain
- Add safe_truncate/dump_ascii for UTF-8 safe string
  truncation in signal handlers
- Refactor write_thread_id to accept thread_id parameter
- Add SA_RESTART for user signal registration, SA_NODEFER
  only when chaining
- Save/restore errno in faulthandler_user_signal
- Add signal re-entrancy guard in trigger_signals to
  prevent recursive handler invocation
- Add thread frame tracking (push/pop/cleanup/reinit)
  with force_unlock fallback for post-fork recovery
- Remove expectedFailure markers for now-passing tests
2026-02-03 13:41:58 +09:00
Jeong, YunWon
111ced08e4 Fix member_descriptor to match CPython behavior (#6915)
descriptor.rs:
- Add __objclass__, __name__ (pymember) and __reduce__ (pymethod)
- Add type check (descr_check) in descr_get; simplify None branch
- Remove incorrect BASETYPE flag
- Add MemberKind::Object (_Py_T_OBJECT = 6)
- Prevent Bool slot deletion (TypeError)
- Raise AttributeError on ObjectEx deletion when already None

pyclass.rs (derive-impl):
- Remove duplicate MemberKind enum; use MemberKindStr (Option<String>)
- Simplify MemberNursery map key from (String, MemberKind) to String
- Support #[pymember(type="object")] for _Py_T_OBJECT semantics

test_inspect.py:
- Remove expectedFailure from test_getdoc (now passing)
2026-02-01 09:41:38 +09:00
Jeong, YunWon
efce325cbf Fix asyncio related compiler/library issues (#6837)
* Fix socket bytes support

* fix unwind_fblock

* fix posix.sendfile

* fix ssl_write

* Fix SSL ZeroReturn

* fix context

* fix generator

* Enable unittest test_async_case again
2026-01-23 19:59:29 +09:00
Lee Dogeon
3bcd071e4d Bump collections to 3.14.2 (#6770)
* Bump collections to 3.14.2

* Unmark resolved tests
2026-01-20 23:58:43 +09:00
Jeong, YunWon
e01f26c1f6 Update inspect from v3.14.2 (#6815)
* Update inspect from v3.14.2

* temp asyncio.event._set_event_loop_policy

* mark inspect tests

---------

Co-authored-by: CPython Developers <>
2026-01-20 21:34:34 +09:00
Jeong, YunWon
1dceb7533d mark failing tests on test_types 2026-01-20 10:59:47 +09:00
Shahar Naveh
a400386774 Remove _dis module (#6690)
* Remove `_dis` module

* Adjust CodeFlag
2026-01-10 22:11:53 +09:00
Jeong, YunWon
a445a22868 fix compiler (#6615) 2026-01-01 16:55:39 +09:00
Jeong, YunWon
527111bc98 PyWrapperDescrObject and rewrite toggle_slot (#6536)
* SlotFunc

* slotdef

* unify slots

* remove unsed slots
2025-12-28 11:44:36 +09:00
Jeong, YunWon
aae6bf566f Add tp_str (#6495)
* clean up hash

* __str__ slot wrapper
2025-12-25 11:00:53 +09:00
Jeong, YunWon
3d7e521acd introduce slot_wrapper (#4884) 2025-12-24 17:29:47 +09:00
Jeong, YunWon
9bbfdf5067 mark expectedFailure 2025-12-12 21:44:00 +09:00
Jeong, YunWon
ef6c6ad117 patch test_inspect 2025-12-12 21:44:00 +09:00
Jeong, YunWon
d22956ebc1 inspect from v3.13.10 2025-12-12 21:43:24 +09:00