-
Notifications
You must be signed in to change notification settings - Fork 197
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
Convert to Python3 #112
base: master
Are you sure you want to change the base?
Convert to Python3 #112
Conversation
if not isinstance(app, cherrypy.Application): | ||
continue | ||
if not app.config: | ||
continue | ||
if sn == '': | ||
continue | ||
sn_atoms = sn.strip("/").split("/") | ||
for key in app.config.keys(): | ||
for key in list(app.config.keys()): |
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 could be the following instead which is faster as when iterated over dicts simply return their keys:
for key in app.config:
@@ -91,7 +91,7 @@ def check_site_config_entries_in_app_config(self): | |||
|
|||
def check_skipped_app_config(self): | |||
"""Check for mounted Applications that have no config.""" | |||
for sn, app in cherrypy.tree.apps.items(): | |||
for sn, app in list(cherrypy.tree.apps.items()): |
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.
Casting the generator returned by .items() to a list is going to make the for loop slower.
Not since Python 3.5 :D |
This should be reconsidered given Python2 reaching end-of-life in January. |
I expect to have time in december to work on that.
Le 16/11/2019 à 18:35, nekokatt a écrit :
… This should be reconsidered given Python2 reaching end-of-life in January.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#112>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMYVXWPMUOPBVEEI44UB6LQUAVM3ANCNFSM4DL24TZA>.
|
using : find . -name '*.py' | xargs 2to3 -w