Skip to content

Commit 98222d9

Browse files
committed
Constant mem address
1 parent c5d831b commit 98222d9

3 files changed

Lines changed: 11 additions & 7 deletions

crates/stdlib/src/_opcode.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,14 +286,18 @@ def f(one: int):
286286
let py_source = r#"
287287
import dis
288288
import io
289+
import re
289290
import sys
290291
291292
old_stdout = sys.stdout
292293
sys.stdout = buf = io.StringIO()
293294
dis.dis(code)
294295
sys.stdout = old_stdout
295296
296-
output = buf.getvalue()
297+
tmp_output = buf.getvalue()
298+
299+
# constant mem address
300+
output = re.sub(r'(<code object \w+ at )0x[0-9a-fA-F]+', r'\g<1>0xmem_address', tmp_output)
297301
"#;
298302

299303
let py_code_obj = vm

crates/stdlib/src/snapshots/rustpython_stdlib___opcode__tests__bare_function_annotations_check_attribute_and_subscript_expressions.snap

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/stdlib/src/snapshots/rustpython_stdlib___opcode__tests__nested_double_async_with.snap

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)