enthought / pyface

pyface: traits-capable windowing framework
Other
105 stars 55 forks source link

`INVERSE_AREA_MAP` type error on Python 3.11 #1193

Closed corranwebster closed 1 year ago

corranwebster commented 1 year ago

Environment

OS: all Python version: 3.11 Toolkit: Qt Qt API: PySide6

Description

Seeing the following error on import for Python 3.11:

  File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/pyface/ui/qt4/tasks/advanced_editor_area_pane.py", line 25, in <module>
    from .main_window_layout import MainWindowLayout, PaneItem
  File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/pyface/ui/qt4/tasks/main_window_layout.py", line 29, in <module>
    from .dock_pane import AREA_MAP
  File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/pyface/ui/qt4/tasks/dock_pane.py", line 31, in <module>
    INVERSE_AREA_MAP = dict((int(v), k) for k, v in AREA_MAP.items())
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/pyface/ui/qt4/tasks/dock_pane.py", line 31, in <genexpr>
    INVERSE_AREA_MAP = dict((int(v), k) for k, v in AREA_MAP.items())
                             ^^^^^^
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'DockWidgetArea'

Steps to Reproduce

Import dock_area.py on Python 3.11

corranwebster commented 1 year ago

This is a duplicate of #1202