diff options
author | ptmcg <ptmcg@austin.rr.com> | 2020-06-22 08:51:26 -0500 |
---|---|---|
committer | ptmcg <ptmcg@austin.rr.com> | 2020-06-22 08:51:26 -0500 |
commit | 6fc0f329eec924c760877eaddb0abb164a861267 (patch) | |
tree | 15859084c8b62cb337ae023b031c7461b60ffaa4 | |
parent | af13023380fe28e2a52f566ea3c8f070fb92f14d (diff) | |
download | pyparsing-git-6fc0f329eec924c760877eaddb0abb164a861267.tar.gz |
Add explicit guard to setup.py against installs using Python < 3.5, for those who do 'python setup.py install' directly instead of going thru pip
-rw-r--r-- | setup.py | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -7,9 +7,16 @@ try: except ImportError: from distutils.core import setup import io +import sys from pyparsing import __version__ as pyparsing_version -# The text of the README file +# guard against manual invocation of setup.py (when using pip, we shouldn't even get this far) +if sys.version_info[:2] < (3, 5): + sys.exit( + "Python < 3.5 is not supported in this version of pyparsing; use latest pyparsing 2.4.x release" + ) + +# get the text of the README file README_name = __file__.replace("setup.py", "README.rst") with io.open(README_name, encoding="utf8") as README: pyparsing_main_doc = README.read() |