Skip to content

Commit

Permalink
pika#1363 Bump examples python version to 3
Browse files Browse the repository at this point in the history
  • Loading branch information
alfawal committed Feb 17, 2023
1 parent e23ddd5 commit ba946f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/examples/blocking_consume.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Example of consuming messages and acknowledging them::
def on_message(channel, method_frame, header_frame, body):
print(method_frame.delivery_tag)
print(body)
print()

channel.basic_ack(delivery_tag=method_frame.delivery_tag)


Expand Down
8 changes: 4 additions & 4 deletions docs/examples/using_urlparameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ Options that are available as query string values:
- keyfile
- ssl_version

For an information on what the ssl_options can be set to reference the `official Python documentation <http://docs.python.org/2/library/ssl.html>`_. Here is an example of setting the client certificate and key::
For an information on what the ssl_options can be set to reference the `official Python documentation <http://docs.python.org/3/library/ssl.html>`_. Here is an example of setting the client certificate and key::

amqp://www-data:rabbit_pwd@rabbit1/web_messages?heartbeat=30&ssl_options=%7B%27keyfile%27%3A+%27%2Fetc%2Fssl%2Fmykey.pem%27%2C+%27certfile%27%3A+%27%2Fetc%2Fssl%2Fmycert.pem%27%7D

The following example demonstrates how to generate the ssl_options string with `Python's urllib <http://docs.python.org/2/library/urllib.html>`_::
The following example demonstrates how to generate the ssl_options string with `Python's urllib <http://docs.python.org/3/library/urllib.html>`_::

import urllib
urllib.parse.urlencode({'ssl_options': {'certfile': '/etc/ssl/mycert.pem', 'keyfile': '/etc/ssl/mykey.pem'}})
from urllib.parse import urlencode
urlencode({'ssl_options': {'certfile': '/etc/ssl/mycert.pem', 'keyfile': '/etc/ssl/mykey.pem'}})


.. rubric:: Footnotes
Expand Down

0 comments on commit ba946f5

Please sign in to comment.