test python version in main script
for better error text on old python related: #5008, #5129
This commit is contained in:
parent
92bf409bf0
commit
0de954546a
@ -26,6 +26,15 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
MIN_PYTHON_VERSION = "3.6.1" # FIXME duplicated from setup.py
|
||||||
|
_min_python_version_tuple = tuple(map(int, (MIN_PYTHON_VERSION.split("."))))
|
||||||
|
|
||||||
|
|
||||||
|
if sys.version_info[:3] < _min_python_version_tuple:
|
||||||
|
sys.exit("Error: Electrum requires Python version >= %s..." % MIN_PYTHON_VERSION)
|
||||||
|
|
||||||
|
|
||||||
script_dir = os.path.dirname(os.path.realpath(__file__))
|
script_dir = os.path.dirname(os.path.realpath(__file__))
|
||||||
is_bundle = getattr(sys, 'frozen', False)
|
is_bundle = getattr(sys, 'frozen', False)
|
||||||
is_local = not is_bundle and os.path.exists(os.path.join(script_dir, "electrum.desktop"))
|
is_local = not is_bundle and os.path.exists(os.path.join(script_dir, "electrum.desktop"))
|
||||||
|
|||||||
2
setup.py
2
setup.py
@ -17,7 +17,7 @@ _min_python_version_tuple = tuple(map(int, (MIN_PYTHON_VERSION.split("."))))
|
|||||||
|
|
||||||
|
|
||||||
if sys.version_info[:3] < _min_python_version_tuple:
|
if sys.version_info[:3] < _min_python_version_tuple:
|
||||||
sys.exit("Error: Electrum requires Python version >= {}...".format(MIN_PYTHON_VERSION))
|
sys.exit("Error: Electrum requires Python version >= %s..." % MIN_PYTHON_VERSION)
|
||||||
|
|
||||||
with open('contrib/requirements/requirements.txt') as f:
|
with open('contrib/requirements/requirements.txt') as f:
|
||||||
requirements = f.read().splitlines()
|
requirements = f.read().splitlines()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user