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

Uninitialized attributes in BaseClient #29

Closed
tabinfl opened this issue Nov 29, 2022 · 0 comments
Closed

Uninitialized attributes in BaseClient #29

tabinfl opened this issue Nov 29, 2022 · 0 comments
Assignees

Comments

@tabinfl
Copy link

tabinfl commented Nov 29, 2022

Describe the bug
Calling is_connected() before a connection attempt accesses uninitialized attribute.

To Reproduce
Call is_connected() before calling connect():

[...]/sliver/client.py", line 52, in is_connected
    return self._channel is not None
AttributeError: 'SliverClient' object has no attribute '_channel'

Fix
Quick fix to BaseClient's __init__ (initialize SliverRPCStub also for good measure):

        self._channel: grpc.aio.Channel = None
        self._stub: SliverRPCStub = None
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

2 participants