contrib: import 'requests' in try-except
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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('..')
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user