Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using cython with argh failed: AttributeError: 'builtin_function_or_method' object has no attribute 'argh_args' #140

Open
speq opened this issue May 23, 2020 · 0 comments
Labels
env-cython Environment: Cython needs testing

Comments

@speq
Copy link

speq commented May 23, 2020

Hi all,
I'm with following code:

import argh

@argh.expects_obj
@argh.arg('-output', default='', help='')
def mainx(args):
    pass

if __name__ == "__main__":
    argh.dispatch_command(mainx)

and build with cython

cython --embed mainx.pyx
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I. -I /tools/el7.x86_64/python3/3.8/include/python3.8 mainx.c /tools/el7.x86_64/python3/3.8/lib/libpython3.8.so -o mainx

exception:

Traceback (most recent call last):
  File "xx.pyx", line 6, in init xx
  File "/tools/el7.x86_64/python/3.8/lib/python3.8/site-packages/argh/decorators.py", line 130, in wrapper
    setattr(func, ATTR_ARGS, declared_args)
AttributeError: 'builtin_function_or_method' object has no attribute 'argh_args'

@neithere neithere added the env-cython Environment: Cython label Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
env-cython Environment: Cython needs testing
Projects
None yet
Development

No branches or pull requests

2 participants