[hooks] Remove list() around repo.sources_by_uri 3.25
authorDenis Laxalde <denis.laxalde@logilab.fr>
Tue, 04 Apr 2017 17:43:56 +0200
branch3.25
changeset 12145 752b94ed9748
parent 12144 f54286c1cef5
child 12146 d540defa0591
[hooks] Remove list() around repo.sources_by_uri There's no need to convert it as a list anymore since sources_by_uri is a property and will not be modified.
cubicweb/hooks/__init__.py
cubicweb/server/serverctl.py
--- a/cubicweb/hooks/__init__.py	Wed Apr 05 14:31:44 2017 +0200
+++ b/cubicweb/hooks/__init__.py	Tue Apr 04 17:43:56 2017 +0200
@@ -56,7 +56,7 @@
         def update_feeds(repo):
             # take a list to avoid iterating on a dictionary whose size may
             # change
-            for uri, source in list(repo.sources_by_uri.items()):
+            for uri, source in repo.sources_by_uri.items():
                 if (uri == 'system'
                     or not repo.config.source_enabled(source)
                     or not source.config['synchronize']):
--- a/cubicweb/server/serverctl.py	Wed Apr 05 14:31:44 2017 +0200
+++ b/cubicweb/server/serverctl.py	Tue Apr 04 17:43:56 2017 +0200
@@ -1063,7 +1063,7 @@
                     else:
                         sources.append(source)
             else:
-                for uri, source in list(repo.sources_by_uri.items()):
+                for uri, source in repo.sources_by_uri.items():
                     if (uri != 'system' and
                             repo.config.source_enabled(source) and
                             source.config['synchronize']):