From 23811e34905b9990ac88c82ed4a7e797987114b4 Mon Sep 17 00:00:00 2001 From: Lars Kruse Date: Tue, 27 Mar 2018 04:59:57 +0200 Subject: [PATCH] Plugin etherscan_balance_: fix style issues; change to python3 --- plugins/currency/ethereum/etherscan_balance_ | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/currency/ethereum/etherscan_balance_ b/plugins/currency/ethereum/etherscan_balance_ index 2445b7f6..497889f4 100755 --- a/plugins/currency/ethereum/etherscan_balance_ +++ b/plugins/currency/ethereum/etherscan_balance_ @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ =head1 NAME @@ -86,7 +86,8 @@ if command == 'config': print("wei_balance_{}.label ETH".format(eth_address)) sys.exit(0) -ethercan_balance_api_url = 'https://api.etherscan.io/api?module=account&action=balance&tag=latest&address=' + eth_address +ethercan_balance_api_url = ('https://api.etherscan.io/api' + '?module=account&action=balance&tag=latest&address=' + eth_address) etherscan_req = Request(ethercan_balance_api_url) # User-Agent to bypass Cloudflare @@ -109,8 +110,8 @@ except ValueError: try: eth = int(etherscan_balance['result']) -except: +except (KeyError, ValueError) as exc: print("JSON result error!", file=sys.stderr) sys.exit(9) -print("wei_balance_{}.value {}".format(eth_address, eth)); +print("wei_balance_{}.value {}".format(eth_address, eth))