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))