From ede6f9e1d3ec75884a3dcdb7c98ee50e5aa3acdb Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Wed, 28 Feb 2018 07:53:18 -0500 Subject: [PATCH] raise an error if not on python 3.6 Signed-off-by: Kenneth Reitz --- requests_html.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/requests_html.py b/requests_html.py index 5eede6d..0be722c 100644 --- a/requests_html.py +++ b/requests_html.py @@ -1,3 +1,4 @@ +import sys import asyncio from urllib.parse import urlparse, urlunparse from concurrent.futures._base import TimeoutError @@ -37,6 +38,13 @@ _Search = Result _Links = Set[str] _Attrs = MutableMapping +# Sanity checking. +try: + assert sys.version_info.major == 3 + assert sys.version_info.minor > 5 +except AssertionError: + raise RuntimeError('Requests-HTML requires Python 3.6+!') + class BaseParser: """A basic HTML/Element Parser, for Humans.