File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3636import pytest
3737
3838import can
39- from can .viewer import KEY_ESC , KEY_SPACE , CanViewer , parse_args
39+ from can .viewer import CanViewer , parse_args
4040
4141
4242# Allow the curses module to be missing (e.g. on PyPy on Windows)
@@ -81,16 +81,18 @@ def nodelay(_bool):
8181 pass
8282
8383 def getch (self ):
84+ assert curses is not None
85+
8486 self .key_counter += 1
8587 if self .key_counter == 1 :
8688 # Send invalid key
8789 return - 1
8890 elif self .key_counter == 2 :
8991 return ord ("c" ) # Clear
9092 elif self .key_counter == 3 :
91- return KEY_SPACE # Pause
93+ return curses . ascii . SP # Pause
9294 elif self .key_counter == 4 :
93- return KEY_SPACE # Unpause
95+ return curses . ascii . SP # Unpause
9496 elif self .key_counter == 5 :
9597 return ord ("s" ) # Sort
9698
@@ -101,7 +103,7 @@ def getch(self):
101103 elif self .key_counter <= 200 :
102104 return curses .KEY_UP
103105
104- return KEY_ESC
106+ return curses . ascii . ESC
105107
106108
107109@unittest .skipUnless (CURSES_AVAILABLE , "curses might be missing on some platforms" )
You can’t perform that action at this time.
0 commit comments