Skip to content

Commit 7708429

Browse files
authored
Merge pull request #930 from marceloneppel/fix-asyncio-on-readme
#930 #### Description The following error is thrown if we run the example code from README. ```sh Traceback (most recent call last): File "/home/ubuntu/main.py", line 6, in <module> from juju import asyncio ImportError: cannot import name 'asyncio' from 'juju' (/home/linuxbrew/.linuxbrew/Cellar/python@3.11/3.11.4_1/lib/python3.11/site-packages/juju/__init__.py) ``` It fails because it should be using `jasyncio`, which is the correct module to import. The the other examples from the `examples` folder are using the correct module. #### QA Steps Add the code from README to a file named `main.py` and run it with `python3 main.py`. The ubuntu charm should be correctly deployed.
2 parents fbf2f62 + 198a5de commit 7708429

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docs/readme.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Pylibjuju requires an already bootstrapped Juju controller to connect to.
5151
import logging
5252
import sys
5353
54-
from juju import asyncio
54+
from juju import jasyncio
5555
from juju.model import Model
5656
5757
@@ -89,7 +89,7 @@ Pylibjuju requires an already bootstrapped Juju controller to connect to.
8989
9090
# Run the deploy coroutine in an asyncio event loop, using a helper
9191
# that abstracts loop creation and teardown.
92-
asyncio.run(deploy())
92+
jasyncio.run(deploy())
9393
9494
9595
if __name__ == '__main__':

0 commit comments

Comments
 (0)