| 319 | **kwargs) |
| 320 | |
| 321 | def __getattr__(self, name): |
| 322 | if name.startswith('__') and name.endswith('__'): |
| 323 | # Prevent RPC calls for non-existing python internal attribute |
| 324 | # access. If someone tries to get an internal attribute |
| 325 | # of RawProxy instance, and the instance does not have this |
| 326 | # attribute, we do not want the bogus RPC call to happen. |
| 327 | raise AttributeError |
| 328 | |
| 329 | # Create a callable to do the actual call |
| 330 | f = lambda *args: self._call(name, *args) |
| 331 | |
| 332 | # Make debuggers show <function bitcoin.rpc.name> rather than <function |
| 333 | # bitcoin.rpc.<lambda>> |
| 334 | f.__name__ = name |
| 335 | return f |
| 336 | |
| 337 | |
| 338 | class Proxy(BaseProxy): |