Changeset 88807 in webkit


Ignore:
Timestamp:
Jun 14, 2011 9:25:04 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-06-14 Benjamin Poulain <benjamin@webkit.org>

Reviewed by Eric Seidel.

KeywordLookupGenerator's Trie does not work with Python 3
https://bugs.webkit.org/show_bug.cgi?id=62635

With Python 3, dict.items() return an iterator. Since the iterator
protocol changed between Python 2 and 3, the easiest way to get the
values is to have something that use the iterator implicitely, like a
for() loop.

  • KeywordLookupGenerator.py:
Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r88724 r88807  
     12011-06-14  Benjamin Poulain  <benjamin@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        KeywordLookupGenerator's Trie does not work with Python 3
     6        https://bugs.webkit.org/show_bug.cgi?id=62635
     7
     8        With Python 3, dict.items() return an iterator. Since the iterator
     9        protocol changed between Python 2 and 3, the easiest way to get the
     10        values is to have something that use the iterator implicitely, like a
     11        for() loop.
     12
     13        * KeywordLookupGenerator.py:
     14
    1152011-06-13  Oliver Hunt  <oliver@apple.com>
    216
  • trunk/Source/JavaScriptCore/KeywordLookupGenerator.py

    r88119 r88807  
    104104        if len(self.keys) != 1:
    105105            return self
    106         (prefix, suffix) = self.keys.items()[0]
    107         res = Trie(self.prefix + prefix)
    108         res.value = suffix.value
    109         res.keys = suffix.keys
    110         return res
     106        # Python 3: for() loop for compatibility. Use next() when Python 2.6 is the baseline.
     107        for (prefix, suffix) in self.keys.items():
     108            res = Trie(self.prefix + prefix)
     109            res.value = suffix.value
     110            res.keys = suffix.keys
     111            return res
    111112
    112113    def fillOut(self, prefix=""):
Note: See TracChangeset for help on using the changeset viewer.