summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelie <elie>2012-07-19 11:24:48 +0000
committerelie <elie>2012-07-19 11:24:48 +0000
commit7c68ea64763382bc2aab8d6c406dfdbfad09ecb5 (patch)
tree0a4ba36f9b178df00e0a5e0a8e7853a1f0bdff16
parentc59eb75d28ac14a0077ab743483843ee66f3de6f (diff)
downloadpyasn1-7c68ea64763382bc2aab8d6c406dfdbfad09ecb5.tar.gz
bail out gracefully whenever Python version is older than 2.4.
-rw-r--r--CHANGES1
-rw-r--r--pyasn1/__init__.py5
2 files changed, 6 insertions, 0 deletions
diff --git a/CHANGES b/CHANGES
index 6629118..8276f70 100644
--- a/CHANGES
+++ b/CHANGES
@@ -18,6 +18,7 @@ Revision 0.1.4
- Package classifiers updated.
- The __init__.py's made non-empty (rumors are that they may be optimized
out by package managers).
+- Bail out gracefully whenever Python version is older than 2.4.
- Fix to Real codec exponent encoding (should be in 2's complement form),
some more test cases added.
- Fix in Boolean truth testing built-in methods
diff --git a/pyasn1/__init__.py b/pyasn1/__init__.py
index 2a2bbbf..2f8d8bd 100644
--- a/pyasn1/__init__.py
+++ b/pyasn1/__init__.py
@@ -1,2 +1,7 @@
+import sys
+
+if sys.version_info[:2] < (2, 4):
+ raise RuntimeError('PyASN1 requires Python 2.4 or later')
+
# http://www.python.org/dev/peps/pep-0396/
__version__ = '0.1.4'