pyvjoy icon indicating copy to clipboard operation
pyvjoy copied to clipboard

NameError: name 'vJoyButtonError' is not defined

Open SimonMeersschaut opened this issue 1 year ago • 0 comments

When I try to set a button that is out of the range of my vjoy controller, I get this error:

  ...
  File "C:\anaconda\lib\site-packages\pyvjoy\vjoydevice.py", line 34, in set_button
    return self._sdk.SetBtn(state,self.rID,buttonID)
  File "C:\anaconda\lib\site-packages\pyvjoy\_sdk.py", line 128, in SetBtn
    raise vJoyButtonError()
NameError: name 'vJoyButtonError' is not defined

In stead of getting a vJoyButtonError-error, I get a NameError stating that vJoyButtonError is not defined. When taking a look at the code that is raising this exception, I saw that it was importing all exceptions from 'exceptions.py' which did not contain vJoyButtonError, only these. For my code I just added this in the exceptions.py, which resolved the problem but I thought someone could add this in the package for all.

SimonMeersschaut avatar Aug 08 '23 18:08 SimonMeersschaut