You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of issue
Using Python 3.7.0, Can not import niswitch (0.9.0 and 1.0.0)
import niswitch
C:\Program Files (x86)\Python37-32\lib\site-packages\niswitch\init.py:7: in
from niswitch.session import Session # noqa: F401
C:\Program Files (x86)\Python37-32\lib\site-packages\niswitch\session.py:7: in
import niswitch._attributes as _attributes
C:\Program Files (x86)\Python37-32\lib\site-packages\niswitch_attributes.py:3: in
import niswitch._converters as _converters
C:\Program Files (x86)\Python37-32\lib\site-packages\niswitch_converters.py:54: in
@_convert_repeated_capabilities.register(six.string_types) # noqa: F811
C:\Program Files (x86)\Python37-32\lib\functools.py:801: in register
f"Invalid first argument to register(): {cls!r}. "
E TypeError: Invalid first argument to register(): (<class 'str'>,). Use either @register(some_class) or plain @register on an annotated function.
!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!
```
You mention niswitch only. Is that because that's the only module from nimi-python that you tried, or because it is the only one that broke? I'm wondering if it's something specific to niswitch or if the issue affects all modules.
Does this work on other Python versions, or have you not tried it? Wondering if it's an installation-specific problem.
It does work fine with python 3.6.5. I do have numpy installed. niswitch is the first of the nimi-python imports, so i'm not sure if the others have the same problem (i've since downgraded python).
Take a look at the commit in the python code base from my original post. I think they changed something on you with @register.
Description of issue
Using Python 3.7.0, Can not import niswitch (0.9.0 and 1.0.0)
import niswitch
C:\Program Files (x86)\Python37-32\lib\site-packages\niswitch\init.py:7: in
from niswitch.session import Session # noqa: F401
C:\Program Files (x86)\Python37-32\lib\site-packages\niswitch\session.py:7: in
import niswitch._attributes as _attributes
C:\Program Files (x86)\Python37-32\lib\site-packages\niswitch_attributes.py:3: in
import niswitch._converters as _converters
C:\Program Files (x86)\Python37-32\lib\site-packages\niswitch_converters.py:54: in
@_convert_repeated_capabilities.register(six.string_types) # noqa: F811
C:\Program Files (x86)\Python37-32\lib\functools.py:801: in register
f"Invalid first argument to
register()
: {cls!r}. "E TypeError: Invalid first argument to
register()
: (<class 'str'>,). Use either@register(some_class)
or plain@register
on an annotated function.!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!
```
Steps to reproduce issue
This may be of interest:
python/cpython@e569753
The text was updated successfully, but these errors were encountered: