Skip to content

Commit bbc9438

Browse files
committed
Fix compatibility with urwid 3.0 (fixes bpython#1043)
1 parent 11d63cc commit bbc9438

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
run: |
3333
python -m pip install --upgrade pip
3434
pip install -r requirements.txt
35-
pip install "urwid < 3.0" twisted watchdog "jedi >=0.16" babel "sphinx >=1.5"
35+
pip install "urwid >= 1.0" twisted watchdog "jedi >=0.16" babel "sphinx >=1.5"
3636
pip install pytest pytest-cov numpy
3737
- name: Build with Python ${{ matrix.python-version }}
3838
run: |

bpython/urwid.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ def keypress(self, size, key):
411411
return key
412412

413413

414-
class Tooltip(urwid.BoxWidget):
414+
class Tooltip(urwid.Widget):
415415
"""Container inspired by Overlay to position our tooltip.
416416
417417
bottom_w should be a BoxWidget.
@@ -423,6 +423,9 @@ class Tooltip(urwid.BoxWidget):
423423
from the bottom window and hides it if there is no cursor.
424424
"""
425425

426+
_sizing = frozenset(['box'])
427+
_selectable = True
428+
426429
def __init__(self, bottom_w, listbox):
427430
super().__init__()
428431

@@ -1322,7 +1325,8 @@ def run_find_coroutine():
13221325

13231326
run_find_coroutine()
13241327

1325-
myrepl.main_loop.screen.run_wrapper(run_with_screen_before_mainloop)
1328+
with myrepl.main_loop.screen.start():
1329+
run_with_screen_before_mainloop()
13261330

13271331
if config.flush_output and not options.quiet:
13281332
sys.stdout.write(myrepl.getstdout())

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ install_requires =
3535
[options.extras_require]
3636
clipboard = pyperclip
3737
jedi = jedi >= 0.16
38-
urwid = urwid >=1.0,< 3.0
38+
urwid = urwid >=1.0
3939
watch = watchdog
4040

4141
[options.entry_points]

0 commit comments

Comments
 (0)