-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix compatibility issues with Python >= 3.6 #352
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
Conversation
Hi @egao1980. What do you mean "$ and . trigger SyntaxError in Python 3.6"?
|
Markdown ate my slashes. Python 3.6 do not allow non standard escapes. So we need to use raw strings or escape the backslash |
But what problem are you trying to solve? This code already works on all versions of Python (besides |
This breaks strict tests with 'python -We ...'
|
tools/benchmark.py
Outdated
@@ -87,7 +88,7 @@ def timed(name, function, args=[], setup=None): | |||
function(*args) | |||
times.append(time.time() - start) | |||
best_time = min(times) | |||
print "%s%d" % (name + (60 - len(name)) * ".", per_trial / best_time) | |||
print("{:s}{:d}".format(name + (60 - len(name)) * ".", per_trial / best_time)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be {0}{1}
to support python 2.6. Or you can just use %
formatting as before which is valid on all python versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, will make sure that 2.6 version works.
Ah I see. That is a problem. My only comment is on the change to |
@egao1980 Thanks! |
Uh oh!
There was an error while loading. Please reload this page.