Closed Bug 1520003 Opened 6 years ago Closed 6 years ago

js/src/gdb/mozilla/ExecutableAllocator.py does not work with python 2

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla66
Tracking Status
firefox66 --- fixed

People

(Reporter: tromey, Assigned: tromey)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0

Steps to reproduce:

Ran the js/src/gdb tests with Python 2.

Actual results:

Traceback (most recent call last):
File "/home/tromey/firefox-git/hg2/js/src/gdb/mozilla/ExecutableAllocator.py", line 41, in to_string
return "ExecutableAllocator([%s])" % ', '.join([str(x) for x in self])
TypeError: iter() returned non-iterator of type 'PoolIterator'

Assertion traceback for ExecutableAllocator.empty:
File "/home/tromey/firefox-git/hg2/js/src/gdb/lib-for-tests/prologue.py", line 108, in <module>
execfile(testscript, globals(), locals())
File "<string>", line 21, in execfile
File "/home/tromey/firefox-git/hg2/js/src/gdb/tests/test-ExecutableAllocator.py", line 10, in <module>
assert_pretty('execAlloc', 'ExecutableAllocator([])')
File "/home/tromey/firefox-git/hg2/js/src/gdb/lib-for-tests/prologue.py", line 56, in assert_pretty
assert_eq(str(value), form)
File "/home/tromey/firefox-git/hg2/js/src/gdb/lib-for-tests/prologue.py", line 38, in assert_eq
actual: %r""" % (expected, actual))

Expected results:

Test should have passed.

ExecutableAllocator.py's PoolIterator is a Python 3 iterator in that it defines the __next__ method. Defining |next| as well lets this code work in Python 2. MozReview-Commit-ID: JlkSsZHZkpw
Assignee: nobody → tom
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by ttromey@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d7d3b47d3a77 make ExecutableAllocator.py work with Python 2; r=nbp
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: