From f62befe4e2a22c4e05a9f3e66812ede03758b10b Mon Sep 17 00:00:00 2001 From: Moul <moul@moul.re> Date: Sat, 27 Apr 2019 21:53:26 +0200 Subject: [PATCH] =?UTF-8?q?[fix]=20#189:=20id:=20handle=20identity=5Fof()?= =?UTF-8?q?=E2=80=99s=20exceptions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- silkaj/wot.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/silkaj/wot.py b/silkaj/wot.py index ac8abfad..09ebf1fe 100644 --- a/silkaj/wot.py +++ b/silkaj/wot.py @@ -159,11 +159,11 @@ def date_approximation(block_id, time_first_block, avgentime): async def id_pubkey_correspondence(id_pubkey): client = ClientInstance().client if check_public_key(id_pubkey, False): - print( - "{} public key corresponds to identity: {}".format( - id_pubkey, await identity_of(id_pubkey) - ) - ) + try: + idty = await identity_of(id_pubkey) + print("{} public key corresponds to identity: {}".format(id_pubkey, idty["uid"])) + except: + message_exit("No matching identity") else: pubkeys = await wot_lookup(id_pubkey) print("Public keys found matching '{}':\n".format(id_pubkey)) -- GitLab