@@ -229,26 +229,30 @@ def begin_upload(self, effect_id):
229229 upload = ff .UInputUpload ()
230230 upload .effect_id = effect_id
231231
232- if self .dll ._uinput_begin_upload (self .fd , ctypes .byref (upload )):
233- raise UInputError ('Failed to begin uinput upload: ' + os .strerror ())
232+ ret = self .dll ._uinput_begin_upload (self .fd , ctypes .byref (upload ))
233+ if ret :
234+ raise UInputError ('Failed to begin uinput upload: ' + os .strerror (ret ))
234235
235236 return upload
236237
237238 def end_upload (self , upload ):
238- if self .dll ._uinput_end_upload (self .fd , ctypes .byref (upload )):
239- raise UInputError ('Failed to end uinput upload: ' + os .strerror ())
239+ ret = self .dll ._uinput_end_upload (self .fd , ctypes .byref (upload ))
240+ if ret :
241+ raise UInputError ('Failed to end uinput upload: ' + os .strerror (ret ))
240242
241243 def begin_erase (self , effect_id ):
242244 erase = ff .UInputErase ()
243245 erase .effect_id = effect_id
244246
245- if self .dll ._uinput_begin_erase (self .fd , ctypes .byref (erase )):
246- raise UInputError ('Failed to begin uinput erase: ' + os .strerror ())
247+ ret = self .dll ._uinput_begin_erase (self .fd , ctypes .byref (erase ))
248+ if ret :
249+ raise UInputError ('Failed to begin uinput erase: ' + os .strerror (ret ))
247250 return erase
248251
249252 def end_erase (self , erase ):
250- if self .dll ._uinput_end_erase (self .fd , ctypes .byref (erase )):
251- raise UInputError ('Failed to end uinput erase: ' + os .strerror ())
253+ ret = self .dll ._uinput_end_erase (self .fd , ctypes .byref (erase ))
254+ if ret :
255+ raise UInputError ('Failed to end uinput erase: ' + os .strerror (ret ))
252256
253257 def _verify (self ):
254258 '''
0 commit comments