Skip to content

Commit 160d3cd

Browse files
committed
fix failing unit tests
1 parent e0089f7 commit 160d3cd

7 files changed

Lines changed: 36 additions & 12 deletions

File tree

Include/internal/pycore_uop_metadata.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/_testinternalcapi/test_cases.c.h

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

Python/bytecodes.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3383,9 +3383,10 @@ dummy_func(
33833383
STAT_INC(COMPARE_OP, hit);
33843384
int64_t ileft;
33853385
int64_t iright;
3386-
assert(_PyLong_TryAsInt64Exact((PyLongObject *)left_o, &ileft));
3387-
assert(_PyLong_TryAsInt64Exact((PyLongObject *)right_o, &iright));
3386+
int ok = _PyLong_TryAsInt64Exact((PyLongObject *)left_o, &ileft)
3387+
&& _PyLong_TryAsInt64Exact((PyLongObject *)right_o, &iright);
33883388
// 2 if <, 4 if >, 8 if ==; this matches the low 4 bits of the oparg
3389+
EXIT_IF(!ok);
33893390
int sign_ish = COMPARISON_BIT(ileft, iright);
33903391
l = left;
33913392
r = right;

Python/executor_cases.c.h

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

Python/generated_cases.c.h

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

Python/optimizer_cases.c.h

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

Tools/scripts/jit_int_benchmark_pyperf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
python Tools/scripts/jit_int_benchmark_pyperf.py -o result.json --rigorous
99
"""
1010

11-
import pyperf
1211
import time
1312

1413

@@ -277,6 +276,7 @@ def bench_small(loops):
277276
]
278277

279278
if __name__ == "__main__":
279+
import pyperf
280280
runner = pyperf.Runner()
281281
for name, fn in BENCHMARKS:
282282
runner.bench_time_func(name, fn)

0 commit comments

Comments
 (0)