◐ Shell
reader mode source ↗
Skip to content

bpo-31803: time.clock() now emits a DeprecationWarning#4020

Merged
vstinner merged 5 commits into
python:masterfrom
vstinner:clock_warn
Oct 17, 2017
Merged

bpo-31803: time.clock() now emits a DeprecationWarning#4020
vstinner merged 5 commits into
python:masterfrom
vstinner:clock_warn

Conversation

@vstinner

@vstinner vstinner commented Oct 17, 2017

Copy link
Copy Markdown
Member

time.clock() and time.get_clock_info('clock') now emit a DeprecationWarning warning.

https://bugs.python.org/issue31803

bpo-31803: time.clock() and time.get_clock_info('clock') now emit a
DeprecationWarning warning.

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide comment

Did you forgot to add a deprecation in get_clock_info('clock')?

Explicitly check that get_clock_info('clock') emits a
DeprecationWarning.

Remove also hasattr(time, 'monotonic') since time.monotonic() is now
always available since Python 3.5.
@vstinner

vstinner commented Oct 17, 2017

Copy link
Copy Markdown
Member Author

Did you forgot to add a deprecation in get_clock_info('clock')?

get_clock_info('clock') also emits a DeprecationWarning. I modified pyclock() which is used by time.clock() and time.get_clock_info('clock').

I just modified test_get_clock_info() to ensure that time.get_clock_info('clock') raises a warning, instead of ignoring the warning.

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide comment

LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants