Skip to content

Commit

Permalink
fix: using datetime.timezone.utc
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Simpson <[email protected]>
  • Loading branch information
Rob Simpson authored and Rob Simpson committed Aug 21, 2023
2 parents ae77313 + a71c318 commit 75d24c5
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions aries_cloudagent/config/ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@

import markdown
import prompt_toolkit
from prompt_toolkit.eventloop.defaults import use_asyncio_event_loop
from prompt_toolkit import __version__ as ptk_version
PTK3 = ptk_version.startswith('3.')
if not PTK3:
from prompt_toolkit.eventloop.defaults import use_asyncio_event_loop
from prompt_toolkit.formatted_text import HTML

from ..config.settings import Settings
Expand Down Expand Up @@ -213,7 +216,8 @@ async def select_aml_tty(taa_info, provision: bool = False) -> Optional[str]:
)

# setup for prompt_toolkit
use_asyncio_event_loop()
if not PTK3:
use_asyncio_event_loop()

prompt_toolkit.print_formatted_text(HTML(taa_html))

Expand All @@ -227,7 +231,10 @@ async def select_aml_tty(taa_info, provision: bool = False) -> Optional[str]:

while True:
try:
opt = await prompt_toolkit.prompt(opts_text, async_=True)
if PTK3:
opt = await prompt_toolkit.PromptSession().prompt_async(opts_text)
else:
opt = await prompt_toolkit.prompt(opts_text, async_=True)
except EOFError:
return None
if not opt:
Expand Down

0 comments on commit 75d24c5

Please sign in to comment.