Skip to content

Add py38 compatibility #1259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion autobahn/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,10 @@ def generate_serial_number():
# first call to this function, as a floating point number, based on the
# Win32 function QueryPerformanceCounter(). The resolution is typically
# better than one microsecond
_rtime = time.clock
if sys.version_info >= (3, 8):

Choose a reason for hiding this comment

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

perf_counter was added in Python 3.3. Why we can't use it for all Python 3.3+ line?
time.clock produces a warning on <Python 3.8

_rtime = time.perf_counter
else:
_rtime = time.clock
_ = _rtime() # this starts wallclock
else:
# On Unix-like platforms, this used the first available from this list:
Expand Down