Skip to content

Commit c3ed088

Browse files
committed
fix code
1 parent da1ece3 commit c3ed088

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

Lib/test/test_code.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ def test_co_positions_artificial_instructions(self):
425425
]
426426
)
427427

428-
# TODO: RUSTPYTHON
428+
# TODO: RUSTPYTHON; no_debug_ranges option not supported
429429
@unittest.expectedFailure
430430
def test_endline_and_columntable_none_when_no_debug_ranges(self):
431431
# Make sure that if `-X no_debug_ranges` is used, there is
@@ -442,7 +442,7 @@ def f():
442442
""")
443443
assert_python_ok('-X', 'no_debug_ranges', '-c', code)
444444

445-
# TODO: RUSTPYTHON
445+
# TODO: RUSTPYTHON; no_debug_ranges option not supported
446446
@unittest.expectedFailure
447447
def test_endline_and_columntable_none_when_no_debug_ranges_env(self):
448448
# Same as above but using the environment variable opt out.

crates/vm/src/builtins/code.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -808,18 +808,10 @@ impl PyCode {
808808
Some(line + end_line_delta)
809809
};
810810

811-
// Convert Option to PyObject (None or int)
812-
// If column == end_column, treat as if column info is not available
813-
// This happens because RustPython's linetable doesn't store separate
814-
// start/end column info
815-
let (final_column, final_end_column) = match (column, end_column) {
816-
(Some(c), Some(ec)) if c == ec => (None, None),
817-
_ => (column, end_column),
818-
};
819811
let line_obj = final_line.to_pyobject(vm);
820812
let end_line_obj = final_endline.to_pyobject(vm);
821-
let column_obj = final_column.to_pyobject(vm);
822-
let end_column_obj = final_end_column.to_pyobject(vm);
813+
let column_obj = column.to_pyobject(vm);
814+
let end_column_obj = end_column.to_pyobject(vm);
823815

824816
let tuple =
825817
vm.ctx

0 commit comments

Comments
 (0)