Skip to content

quantity_input fails when no annotations are present on keyword only arguments #7551

Closed

Description

@Cadair
>>> @u.quantity_input
    def test(a: u.pix, *, bob):
        print(a, bob)
        
xonsh: To log full traceback to a file set: $XONSH_TRACEBACK_LOGFILE = <filename>
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 14901, in default
    run_compiled_code(code, self.ctx, None, 'single')
  File "/usr/lib/python3.6/site-packages/xonsh/__amalgam__.py", line 2326, in run_compiled_code
    func(code, glb, loc)
  File "<xonsh-code>", line 2, in <module>
  File "/usr/lib/python3.6/site-packages/astropy/units/decorators.py", line 147, in as_decorator
    return self(func)
  File "/usr/lib/python3.6/site-packages/astropy/units/decorators.py", line 161, in __call__
    @wraps(wrapped_function)
  File "/usr/lib/python3.6/site-packages/astropy/utils/decorators.py", line 819, in wraps
    wrapped_args = _get_function_args(wrapped, exclude_args=exclude_args)
  File "/usr/lib/python3.6/site-packages/astropy/utils/decorators.py", line 866, in _get_function_args
    all_args = _get_function_args_internal(func)
  File "/usr/lib/python3.6/site-packages/astropy/utils/decorators.py", line 859, in _get_function_args_internal
    for argname in argspec.kwonlyargs)
  File "/usr/lib/python3.6/site-packages/astropy/utils/decorators.py", line 859, in <genexpr>
    for argname in argspec.kwonlyargs)
TypeError: 'NoneType' object is not subscriptable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions