Skip to content

Commit

Permalink
Merge pull request #254 from PyAr/forbid-install-under-py2
Browse files Browse the repository at this point in the history
Forbid installation under Python 2. Fixes #221.
  • Loading branch information
gilgamezh authored May 5, 2017
2 parents 7d52d56 + a670d67 commit 4d0da65
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,26 @@
import os
import re
import shutil
import sys
import zlib

from distutils.core import setup
from setuptools.command.install import install

_PY2_MESSAGE = (
b"x\x9c\xb5QA\x0e\x800\x08\xbb\xf3\nnjb\xb2\x0f-\xc1\x87\xec\xf1\x0e\xda\xe1f\xbc\xca2\x02\xa5"
b"Ep\xa2j\xddt2\x9b\xfc\x97\xbd\xf9\x9f\x9cW\x9c\xb9h\xf3\xac>x\xd3Fo\xa3=T\xcc\x9b\x03U\x13"
b"\xcb:\xafe\x0f\xa8{\xac\xbb\x1d,I\xd4\x0e\xf7y\xc0\xd9\xd0\xb5`\x9a\xccC\xe7|b\xd7\xa8"
b"\xe3\x14\xaa\xddC}\xb1\x82N\xd8\xcf\nf\xa2\xcat\xfa\xfa\xbeL\x83\x1e\xce\xd7e\xc6"
b"\xa1\xae\xb1\xfc\xd8\xcf\xd5\x93\xb6\xeb$xa\x9dz:ZcB^\xcfb\x9a\x91\xc7\xff4F+"
b"\xef\x8c8\xe8\x95\xfb%\xcaNM\x9ew%\xf5G\x93\x1bF\xf1\x97\x0f")

# forbid the installation in a python2 environment
if sys.version_info.major < 3:
print(zlib.decompress(_PY2_MESSAGE).decode('ascii'))
print("fades is a python3 only project, sorry!\n")
raise ValueError("fades is a python3 only project, sorry!")


def get_version():
"""Retrieves package version from the file."""
Expand Down

0 comments on commit 4d0da65

Please sign in to comment.