From 8d52cc628eecf66ec0569c5fbafbe03ce93883d0 Mon Sep 17 00:00:00 2001 From: Yichen Yan Date: Mon, 23 May 2022 23:03:08 +0800 Subject: [PATCH] Reject --tracemalloc in `pyperf command` --- TODO.rst | 1 - doc/changelog.rst | 6 ++++++ pyperf/_runner.py | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/TODO.rst b/TODO.rst index 517c5eeb..a5fa8560 100644 --- a/TODO.rst +++ b/TODO.rst @@ -2,7 +2,6 @@ BUGS ==== * Repair PyPy on Travis -* Reject --tracemalloc in bench_command() * BUG: "python pyperf timeit --compare-to=pypy" doesn't tune correctly the runner for pypy. pypy requires more warmup values (10) than cpython (1). * BUG: --duplicate of timeit must be ignored in PyPy, see the discussion diff --git a/doc/changelog.rst b/doc/changelog.rst index c722fc49..3fc8eddb 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -1,6 +1,12 @@ Changelog ========= +Version 2.4.1 +------------- + +* Reject --tracemalloc in ``pyperf command``. + Patch by Yichen Yan + Version 2.4.0 (2022-07-20) -------------------------- diff --git a/pyperf/_runner.py b/pyperf/_runner.py index 6c0d9e2b..9be8909b 100644 --- a/pyperf/_runner.py +++ b/pyperf/_runner.py @@ -324,6 +324,8 @@ def _process_args_impl(self): self._only_in_worker("--worker-task") if args.tracemalloc: + if args.action == 'command': + raise CLIError('--tracemalloc cannot be used with pyperf command') try: import tracemalloc # noqa except ImportError as exc: