Skip to content

Commit

Permalink
Merge pull request #385 from meejah/doc-improvements
Browse files Browse the repository at this point in the history
Doc improvements
  • Loading branch information
meejah committed Aug 11, 2023
2 parents d4c3e2f + 3002109 commit 3db7283
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
8 changes: 8 additions & 0 deletions docs/introduction.rst
Expand Up @@ -99,6 +99,14 @@ Example Code
.. literalinclude:: ../examples/readme.py


.. _testimonials:

Testimonials
------------

- `@thegrugq <https://twitter.com/thegrugq/status/359495805025001472>`_: "Holy fucking shit, the awesomeness of this project cannot be denied!" (July 2013)


.. _known_users:

Known Users
Expand Down
4 changes: 2 additions & 2 deletions test/test_torcontrolprotocol.py
Expand Up @@ -74,7 +74,7 @@ def setUp(self):
self.transport = proto_helpers.StringTransport()

def send(self, line):
assert type(line) == bytes
assert isinstance(line, bytes)
self.protocol.dataReceived(line.strip() + b"\r\n")

def test_authenticate_cookie(self):
Expand Down Expand Up @@ -297,7 +297,7 @@ def tearDown(self):
self.protocol = None

def send(self, line):
assert type(line) == bytes
assert isinstance(line, bytes)
self.protocol.dataReceived(line.strip() + b"\r\n")

def test_statemachine_broadcast_no_code(self):
Expand Down
2 changes: 2 additions & 0 deletions txtorcon/controller.py
Expand Up @@ -1032,6 +1032,8 @@ def create_onion_service(self, ports, private_key=None, version=3,
control-connection goes away (this means the service will
appear in `GETINFO onions/detached` to all other
controllers)
:returns EphemeralOnionService:
"""
if version not in (2, 3):
raise ValueError(
Expand Down
4 changes: 2 additions & 2 deletions txtorcon/torstate.py
Expand Up @@ -477,7 +477,7 @@ def close_stream(self, stream, reason='REASON_MISC', **kwargs):
(e.g. "SomeFlag=True"). Currently there are none that Tor accepts.
"""

if type(stream) != int:
if not isinstance(stream, int):
# assume it's a Stream instance
stream = stream.id
try:
Expand Down Expand Up @@ -513,7 +513,7 @@ def close_circuit(self, circid, **kwargs):
:meth:`Circuit.close <txtorcon.circuit.Circuit.close>`
"""

if type(circid) != int:
if not isinstance(circid, int):
# assume it's a Circuit instance
circid = circid.id
flags = flags_from_dict(kwargs)
Expand Down

0 comments on commit 3db7283

Please sign in to comment.