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

Consider alternative way of wrapping #4

Open
kratsg opened this issue Mar 21, 2022 · 0 comments
Open

Consider alternative way of wrapping #4

kratsg opened this issue Mar 21, 2022 · 0 comments

Comments

@kratsg
Copy link
Owner

kratsg commented Mar 21, 2022

    import wrapt
    @wrapt.patch_function_wrapper(ctypes.CDLL, '__init__')
    def new_init(
        wrapped,
        instance,
        args: tuple,
        kwargs: dict[Any]
    ) -> None:
        args = list(args)
        if args:
            path = data / args[0]
            if path.is_file():
                 args[0] = str(path)
        wrapped(*args, **kwargs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant