Raise an exception under Python < 3.4.

It also cleans up the README to remove references to Python 2
and removes Python 2-isms from the main config.

refs #5443
This commit is contained in:
Dave Page
2020-04-30 14:17:00 +05:30
committed by Akshay Joshi
parent 109051e1d5
commit 7dd00a1494
4 changed files with 28 additions and 41 deletions

View File

@@ -11,15 +11,11 @@
#
##########################################################################
import builtins
import logging
import os
import sys
import json
if sys.version_info[0] >= 3:
import builtins
else:
import __builtin__ as builtins
# We need to include the root directory in sys.path to ensure that we can
# find everything we need when running in the standalone runtime.
@@ -27,7 +23,7 @@ root = os.path.dirname(os.path.realpath(__file__))
if sys.path[0] != root:
sys.path.insert(0, root)
from pgadmin.utils import env, IS_PY2, IS_WIN, fs_short_path
from pgadmin.utils import env, IS_WIN, fs_short_path
##########################################################################
# Application settings
@@ -566,15 +562,6 @@ try:
except ImportError:
pass
# SUPPORT_SSH_TUNNEL can be override in local config file and if that
# setting is False in local config then we should not check the Python version.
if (SUPPORT_SSH_TUNNEL is True and
((sys.version_info[0] == 2 and sys.version_info[1] < 7) or
(sys.version_info[0] == 3 and sys.version_info[1] < 4))):
SUPPORT_SSH_TUNNEL = False
ALLOW_SAVE_TUNNEL_PASSWORD = False
# Disable USER_INACTIVITY_TIMEOUT when SERVER_MODE=False
if not SERVER_MODE:
USER_INACTIVITY_TIMEOUT = 0

View File

@@ -11,13 +11,14 @@
a webserver, this will provide the WSGI interface, otherwise, we're going
to start a web server."""
import os
import sys
if sys.version_info[0] >= 3:
import builtins
else:
import __builtin__ as builtins
if sys.version_info < (3, 4):
raise Exception('This application must be run under Python 3.4 or later.')
import builtins
import os
# We need to include the root directory in sys.path to ensure that we can
# find everything we need when running in the standalone runtime.

View File

@@ -24,10 +24,10 @@ import coverage
import unittest
if sys.version_info[0] >= 3:
import builtins
else:
import __builtin__ as builtins
if sys.version_info < (3, 4):
raise Exception('The test suite must be run under Python 3.4 or later.')
import builtins
# Ensure the global server mode is set.
builtins.SERVER_MODE = None