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

__getstate__ trouble #3

Open
grizlupo opened this issue Mar 18, 2022 · 0 comments
Open

__getstate__ trouble #3

grizlupo opened this issue Mar 18, 2022 · 0 comments

Comments

@grizlupo
Copy link

Windows 10
Python 3.10
Panda3d 1.10.11

Issues when the name argument of ViewerAppProxy.getattr is either getstate or setstate.
(I'm guessing deadlock is occurring. )

I solved it by throwing an exception for these names.

    def __getattr__(self, name):
        """Redirect method calls to the sub-process.

        Arguments:
            name {str} -- attribute name

        Returns:
            callable -- an application method wrapper
        """
        if name.startswith("__"):
            return self.__getattribute__(name)  # raise AttributeError

        def _send(*args, **kwargs):
            self._host_conn.send((name, args, kwargs))
            reply = self._host_conn.recv()
            if isinstance(reply, Exception):
                raise reply
            return reply

        return _send

Thanks for reading.

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