Browse Source

contrib: import 'requests' in try-except

3.3.3.1
SomberNight 6 years ago
parent
commit
8b775fd24a
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 5
      contrib/deterministic-build/find_restricted_dependencies.py
  2. 7
      contrib/make_locale
  3. 2
      electrum/gui/kivy/main_window.py
  4. 2
      electrum/tests/test_bitcoin.py
  5. 2
      run_electrum

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

7
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('..')

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

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

2
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

Loading…
Cancel
Save