File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 2929import termios
3030import optparse
3131
32+ try :
33+ input = raw_input
34+ except NameError :
35+ pass
36+
3237from evdev import ecodes , list_devices , AbsInfo , InputDevice
3338
3439
@@ -105,6 +110,9 @@ def devicenum(device_path):
105110 choices = choices .split ()
106111 choices = [devices [int (num )] for num in choices ]
107112 except ValueError :
113+ choices = None
114+
115+ if not choices :
108116 msg = 'error: invalid input - please enter one or more numbers separated by spaces'
109117 print (msg , file = sys .stderr )
110118 sys .exit (1 )
Original file line number Diff line number Diff line change @@ -112,16 +112,17 @@ class cmdbuild_ext(build_ext.build_ext):
112112
113113 def initialize_options (self ):
114114 self .evdev_headers = None
115- super (cmdbuild_ext , self ).initialize_options ()
115+ # We cannot use super(cmdbuild_ext, self) here for compatibility with Py2.
116+ build_ext .build_ext .initialize_options (self )
116117
117118 def finalize_options (self ):
118119 if self .evdev_headers :
119120 self .evdev_headers = self .evdev_headers .split (':' )
120- super ( cmdbuild_ext , self ). finalize_options ()
121+ build_ext . build_ext . finalize_options (self )
121122
122123 def run (self ):
123124 create_ecodes (self .evdev_headers )
124- super ( cmdbuild_ext , self ). run ()
125+ build_ext . build_ext . run (self )
125126
126127#-----------------------------------------------------------------------------
127128kw ['cmdclass' ]['build_ext' ] = cmdbuild_ext
You can’t perform that action at this time.
0 commit comments