electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 8b775fd24a0af1a03d8bab1ac5683fe988ab7808
parent 78f5afff7461830951245c971cec02e19d401edf
Author: SomberNight <somber.night@protonmail.com>
Date:   Thu, 13 Dec 2018 23:25:52 +0100

contrib: import 'requests' in try-except

Diffstat:
Mcontrib/deterministic-build/find_restricted_dependencies.py | 5++++-
Mcontrib/make_locale | 7++++++-
Melectrum/gui/kivy/main_window.py | 2+-
Melectrum/tests/test_bitcoin.py | 2+-
Mrun_electrum | 2+-
5 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/contrib/deterministic-build/find_restricted_dependencies.py b/contrib/deterministic-build/find_restricted_dependencies.py @@ -1,7 +1,10 @@ #!/usr/bin/env python3 import sys -import requests +try: + import requests +except ImportError as e: + sys.exit(f"Error: {str(e)}. Try 'sudo python3 -m pip install <module-name>'") def check_restriction(p, r): diff --git a/contrib/make_locale b/contrib/make_locale @@ -3,7 +3,12 @@ import os import subprocess import io import zipfile -import requests +import sys + +try: + import requests +except ImportError as e: + sys.exit(f"Error: {str(e)}. Try 'sudo python3 -m pip install <module-name>'") os.chdir(os.path.dirname(os.path.realpath(__file__))) os.chdir('..') diff --git a/electrum/gui/kivy/main_window.py b/electrum/gui/kivy/main_window.py @@ -790,7 +790,7 @@ class ElectrumWindow(App): notification.notify('Electrum', message, app_icon=icon, app_name='Electrum') except ImportError: - Logger.Error('Notification: needs plyer; `sudo pip install plyer`') + Logger.Error('Notification: needs plyer; `sudo python3 -m pip install plyer`') def on_pause(self): self.pause_time = time.time() diff --git a/electrum/tests/test_bitcoin.py b/electrum/tests/test_bitcoin.py @@ -29,7 +29,7 @@ from . import FAST_TESTS try: import ecdsa except ImportError: - sys.exit("Error: python-ecdsa does not seem to be installed. Try 'sudo pip install ecdsa'") + sys.exit("Error: python-ecdsa does not seem to be installed. Try 'sudo python3 -m pip install ecdsa'") def needs_test_with_all_ecc_implementations(func): diff --git a/run_electrum b/run_electrum @@ -50,7 +50,7 @@ def check_imports(): import jsonrpclib import aiorpcx except ImportError as e: - sys.exit("Error: %s. Try 'sudo pip install <module-name>'"%str(e)) + sys.exit(f"Error: {str(e)}. Try 'sudo python3 -m pip install <module-name>'") # the following imports are for pyinstaller from google.protobuf import descriptor from google.protobuf import message