The 'Array' class is present in more than one python standard library. In some versions of Python 3, the following error occurs: Traceback (most recent call last): File "tools/perf/scripts/python/exported-sql-viewer.py", line 4702, in <lambda> reports_menu.addAction(CreateAction(label, "Create a new window displaying branch events", lambda a=None,x=dbid: self.NewBranchView(x), self)) File "tools/perf/scripts/python/exported-sql-viewer.py", line 4727, in NewBranchView BranchWindow(self.glb, event_id, ReportVars(), self) File "tools/perf/scripts/python/exported-sql-viewer.py", line 3208, in __init__ self.model = LookupCreateModel(model_name, lambda: BranchModel(glb, event_id, report_vars.where_clause)) File "tools/perf/scripts/python/exported-sql-viewer.py", line 343, in LookupCreateModel model = create_fn() File "tools/perf/scripts/python/exported-sql-viewer.py", line 3208, in <lambda> self.model = LookupCreateModel(model_name, lambda: BranchModel(glb, event_id, report_vars.where_clause)) File "tools/perf/scripts/python/exported-sql-viewer.py", line 3124, in __init__ self.fetcher = SQLFetcher(glb, sql, prep, self.AddSample) File "tools/perf/scripts/python/exported-sql-viewer.py", line 2658, in __init__ self.buffer = Array(c_char, self.buffer_size, lock=False) TypeError: abstract class This apparently happens because Python can be inconsistent about which class of the name 'Array' gets imported. Fix by importing explicitly by name so that only the desired 'Array' gets imported.
Showing the changes to tools/perf/scripts/python (1 of 1 file). Show all
Unified · Split
| @@ -125,8 +125,9 @@ if pyside_version_1: · 124 unmodified lines | |||
| 125 | from PySide.QtGui import * | 125 | from PySide.QtGui import * |
| 126 | from PySide.QtSql import * | 126 | from PySide.QtSql import * |
| 127 | 127 | ||
| 128 | from decimal import * | 128 | from decimal import Decimal, ROUND_HALF_UP |
| 129 | from ctypes import * | 129 | from ctypes import CDLL, Structure, create_string_buffer, addressof, sizeof, \ |
| 130 | c_void_p, c_bool, c_byte, c_char, c_int, c_uint, c_longlong, c_ulonglong | ||
| 130 | from multiprocessing import Process, Array, Value, Event | 131 | from multiprocessing import Process, Array, Value, Event |
| 131 | 132 | ||
| 132 | # xrange is range in Python3 | 133 | # xrange is range in Python3 |