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

RESOLVED FIXED in Firefox 66

Status

()

defect
RESOLVED FIXED
5 months ago
5 months ago

People

(Reporter: tromey, Assigned: tromey)

Tracking

Trunk
mozilla66
Points:
---

Firefox Tracking Flags

(firefox66 fixed)

Details

Attachments

(1 attachment)

Assignee

Description

5 months ago

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.

Assignee

Comment 1

5 months ago
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

Comment 2

5 months ago
Pushed by ttromey@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d7d3b47d3a77
make ExecutableAllocator.py work with Python 2; r=nbp

Comment 3

5 months ago
bugherder
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
You need to log in before you can comment on or make changes to this bug.