summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2016-02-13 21:19:33 -0600
committerPaul Kehrer <paul.l.kehrer@gmail.com>2016-02-13 21:19:33 -0600
commit9a5236cec465c5a563a9f235b12e600286c61ea7 (patch)
treec915f4571e3a7b3cb34f2c816e0ee60a335f57d3
parent37c26f8779f17d9c078ec23e64931c30edd23926 (diff)
downloadpy-bcrypt-git-9a5236cec465c5a563a9f235b12e600286c61ea7.tar.gz
raise a decent error if pypy <2.6 + update README
-rw-r--r--README.rst2
-rw-r--r--setup.py9
2 files changed, 10 insertions, 1 deletions
diff --git a/README.rst b/README.rst
index 0f4fc33..5f735b2 100644
--- a/README.rst
+++ b/README.rst
@@ -105,7 +105,7 @@ Compatibility
-------------
This library should be compatible with py-bcrypt and it will run on Python
-2.6+, 3.3+, and PyPy.
+2.6+, 3.3+, and PyPy 2.6+.
Security
--------
diff --git a/setup.py b/setup.py
index fa82e91..060e675 100644
--- a/setup.py
+++ b/setup.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+import platform
import sys
from distutils.command.build import build
@@ -22,6 +23,14 @@ with open("src/bcrypt/__about__.py") as fp:
exec(fp.read(), __about__)
+if platform.python_implementation() == "PyPy":
+ if sys.pypy_version_info < (2, 6):
+ raise RuntimeError(
+ "bcrypt is not compatible with PyPy < 2.6. Please upgrade PyPy to "
+ "use this library."
+ )
+
+
class PyTest(test):
def finalize_options(self):
test.finalize_options(self)