Skip to content

Commit c562f28

Browse files
committed
Give a more useful error message than a SyntaxError on old setuptools
1 parent 21aabd6 commit c562f28

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

setup.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1+
from __future__ import print_function
2+
13
import ast
24
import codecs
5+
import sys
36

47
from os.path import join, dirname
5-
from setuptools import setup, find_packages
8+
from setuptools import setup, find_packages, __version__ as setuptools_version
9+
from pkg_resources import parse_version
610

11+
if parse_version(setuptools_version) < parse_version("18.5"):
12+
print("html5lib requires setuptools version 18.5 or above; "
13+
"please upgrade before installing (you have %s)" % setuptools_version)
14+
sys.exit(1)
715

816
classifiers = [
917
'Development Status :: 5 - Production/Stable',

0 commit comments

Comments
 (0)