Open
Conversation
Owner
|
Hello, Apologies for the delay on replying - we appreciate your efforts and interest in improving this library! We are aware that the time.clock() function has been removed, however in order to maintain support for older versions of Python, namely Python 2.7, we need to keep it in the library. The call is surrounded by a try-except clause, meaning that when running the code in a version which no longer supports time.clock(), time.process_time() is called instead. Changing time.clock() to time.process_time() in these cases would make the code in both the try and except blocks identical: try:
# Python 2.7
if self._requests_left is None or \
- time.clock() > (self._last_response_received_time
+ time.process_time() > (self._last_response_received_time
+ _ALLOWANCE_STATE_REFRESH_SECONDS):
self._get_usage()
except AttributeError:
# Python 3.3+
if self._requests_left is None or \
time.process_time() > (self._last_response_received_time
+ _ALLOWANCE_STATE_REFRESH_SECONDS):
self._get_usage()Please let us know if there are any other issues with this! If not, this pull request will be closed. And thank you again for your time! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Apparently, time.clock() was removed in Python 3.8.
I followed the advice in https://stackoverflow.com/questions/58569361/attributeerror-module-time-has-no-attribute-clock-in-python-3-8