changeset 4740:f8ef6d5f56f2

py3: don't depend on map() iterating over its input map(some_generator()) in py2 returns a list, while in py3 it returns a generator, so the passed-in generator won't be called unless the returned one is.
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 12 Jul 2019 23:19:50 -0700
parents ce6e69b2f759
children e8727a27e380
files hgext3rd/evolve/__init__.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/__init__.py	Thu Jul 11 16:49:01 2019 -0700
+++ b/hgext3rd/evolve/__init__.py	Fri Jul 12 23:19:50 2019 -0700
@@ -1322,7 +1322,8 @@
             markers.append(m)
         ui.write(_('Old store is version %d, will rewrite in version %d\n') % (
             repo.obsstore._version, new_format))
-        map(f.write, obsolete.encodemarkers(markers, True, new_format))
+        for data in obsolete.encodemarkers(markers, True, new_format):
+            f.write(data)
         f.close()
     ui.write(_('Done!\n'))