Commit 14b17906 authored by Guillaume Binet's avatar Guillaume Binet

Removed 3.4/3.5 conditional imports.

parent 584edda8
......@@ -12,11 +12,7 @@ from errbot import botcmd, BotPlugin, webhook
from urllib.request import unquote
try:
from OpenSSL import crypto
has_crypto = True
except ImportError:
has_crypto = False
from OpenSSL import crypto
TEST_REPORT = """*** Test Report
URL : %s
......@@ -178,11 +174,6 @@ class Webserver(BotPlugin):
"""
Generate a self-signed SSL certificate for the Webserver
"""
if not has_crypto:
yield ("It looks like pyOpenSSL isn't installed. Please install this "
"package using for example `pip install pyOpenSSL`, then try again")
return
yield ("Generating a new private key and certificate. This could take a "
"while if your system is slow or low on entropy")
key_path = os.sep.join((self.bot_config.BOT_DATA_DIR, "webserver_key.pem"))
......
......@@ -25,11 +25,6 @@ log = logging.getLogger(__name__)
CORE_PLUGINS = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'core_plugins')
try:
from importlib import reload # new in python 3.4
except ImportError:
from imp import reload # noqa
class PluginActivationException(Exception):
pass
......
......@@ -18,11 +18,7 @@ from ansi.color import fg, bg, fx
log = logging.getLogger(__name__)
try:
from html import unescape # py3.5
except ImportError:
from html.parser import HTMLParser # py3.4
unescape = HTMLParser().unescape
from html import unescape
# chr that should not count as a space
......
......@@ -21,13 +21,12 @@ from platform import system
from setuptools import setup, find_packages
py_version = sys.version_info[:2]
PY35_OR_GREATER = py_version >= (3, 5)
PY37_OR_GREATER = py_version >= (3, 7)
ON_WINDOWS = system() == 'Windows'
if py_version < (3, 4):
raise RuntimeError('Errbot requires Python 3.4 or later')
if py_version < (3, 6):
raise RuntimeError('Errbot requires Python 3.6 or later')
VERSION_FILE = os.path.join('errbot', 'version.py')
......@@ -45,9 +44,6 @@ deps = ['webtest',
'dnspython3',
]
if not PY35_OR_GREATER:
deps += ['typing', ] # backward compatibility for 3.3 and 3.4
if not PY37_OR_GREATER:
deps += ['dataclasses'] # backward compatibility for 3.3->3.6 for dataclasses
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment