Skip to content

Patch/python38 clock - #16258

Merged
opencv-pushbot merged 1 commit into
opencv:3.4from
dapperfu:patch/python38-clock
Dec 30, 2019
Merged

opencv-pushbot merged 1 commit into
opencv:3.4from
dapperfu:patch/python38-clock

Conversation

@dapperfu

Copy link
Copy Markdown

This pullrequest changes

Removed clock import from time module. It was removed in Python3.8 and causes the samples not to run.

It appears to be unused in both of the changed files.

digits_adjust.py, facedetect.py, and videa_threaded.py all use the clock() function from common.py

Python 3.7:

Python 3.7.5 (default, Nov 20 2019, 09:21:52) 
[GCC 9.2.1 20191008] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from time import clock
>>> clock()
__main__:1: DeprecationWarning: time.clock has been deprecated in Python 3.3 and will be removed from Python 3.8: use time.perf_counter or time.process_time instead

Python 3.8:

Python 3.8.0 (default, Oct 28 2019, 16:14:01) 
[GCC 9.2.1 20191008] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from time import clock

...

Original exception was:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'clock' from 'time' (unknown location)

@alalek alalek 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.

Thank you for contribution 👍

@opencv-pushbot
opencv-pushbot merged commit ef29036 into opencv:3.4 Dec 30, 2019
@alalek alalek mentioned this pull request Dec 31, 2019
SavyaSanchi-Sharma pushed a commit to SavyaSanchi-Sharma/opencv that referenced this pull request Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants