diff options
author | Edmund Fokschaner <eddyaod@gmail.com> | 2013-12-06 20:29:33 -0800 |
---|---|---|
committer | Edmund Fokschaner <eddyaod@gmail.com> | 2013-12-06 20:37:29 -0800 |
commit | e09bd389a7d94f2bff28290355ced6f6b24436c7 (patch) | |
tree | 42454413d3720bd53eb7706675fff0f39268cbe8 | |
parent | 53c8ffcfe4dd1718086cc551dce8ac459e8abc67 (diff) | |
download | jsonrpclib-e09bd389a7d94f2bff28290355ced6f6b24436c7.tar.gz |
Fixing bug with jsonrpc._Method caused by debugger
Adding __repr__, __str__ and __dir__ to jsonrpc._Method in order to avoid
issues with PyCharm debugger due to these functions being called and
accessing __getattr__ which mutates the _Method object
-rw-r--r-- | jsonrpclib/jsonrpc.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/jsonrpclib/jsonrpc.py b/jsonrpclib/jsonrpc.py index e11939a..c46f1be 100644 --- a/jsonrpclib/jsonrpc.py +++ b/jsonrpclib/jsonrpc.py @@ -282,6 +282,15 @@ class _Method(XML_Method): # The only thing that changes is the name. #return _Method(self.__send, "%s.%s" % (self.__name, name)) + def __repr__(self): + return '<{} "{}">'.format(self.__class__.__name__, self.__name) + + def __str__(self): + return self.__repr__() + + def __dir__(self): + return self.__dict__.keys() + class _Notify(object): def __init__(self, request): self._request = request |