Skip to content

Commit

Permalink
Attempt to let curses run despite no tty
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbrittain committed Sep 17, 2023
1 parent 99b2ec6 commit 728cbe4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt list --installed
python -m pip install --upgrade pip
pip install -r requirements/dev.txt
- name: Test
Expand Down
6 changes: 5 additions & 1 deletion asciimatics/screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -1369,7 +1369,11 @@ def open(cls, height=None, catch_interrupt=False, unicode_aware=None):
# Reproduce curses.wrapper()
stdscr = curses.initscr()
curses.noecho()
curses.cbreak()
# Shouldn't fail on real systems. This code is for running tests in CI pipelines.
try:
curses.cbreak()
except curses.error:
pass
stdscr.keypad(1)

# Fed up with linters complaining about original curses code - trying to be a bit better...
Expand Down

0 comments on commit 728cbe4

Please sign in to comment.