diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2020-09-22 13:16:46 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-22 13:16:46 (GMT) |
commit | 557b9a52edc4445cec293f2cc2c268c4f564adcf (patch) | |
tree | dc197fd8a194d1eb5fb31eb6f12736efa09ff7e7 /Lib/timeit.py | |
parent | c5cb077ab3c88394b7ac8ed4e746bd31b53e39f1 (diff) | |
download | cpython-557b9a52edc4445cec293f2cc2c268c4f564adcf.zip cpython-557b9a52edc4445cec293f2cc2c268c4f564adcf.tar.gz cpython-557b9a52edc4445cec293f2cc2c268c4f564adcf.tar.bz2 |
bpo-40670: More reliable validation of statements in timeit.Timer. (GH-22358)
It now accepts "empty" statements (only whitespaces and comments)
and rejects misindentent statements.
Diffstat (limited to 'Lib/timeit.py')
-rwxr-xr-x | Lib/timeit.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/timeit.py b/Lib/timeit.py index 6c3ec01..9dfd454 100755 --- a/Lib/timeit.py +++ b/Lib/timeit.py @@ -72,6 +72,7 @@ def inner(_it, _timer{init}): _t0 = _timer() for _i in _it: {stmt} + pass _t1 = _timer() return _t1 - _t0 """ |