diff options
author | Erik Rose <erik@mozilla.com> | 2011-11-27 13:32:08 -0800 |
---|---|---|
committer | Erik Rose <erik@mozilla.com> | 2011-11-27 13:32:08 -0800 |
commit | 381bfb79a7476a6e958b7d08d3a80de4c4cabeac (patch) | |
tree | baba4c2dfdd741e9a4b23facc2a76ce3efb3c7c1 | |
parent | bf9dbec7fd5dfa05d5844e3c15291078f7c0b62f (diff) | |
download | blessings-381bfb79a7476a6e958b7d08d3a80de4c4cabeac.tar.gz |
Explode more informatively if Python 3 version < 3.2.3.
-rw-r--r-- | blessings/__init__.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/blessings/__init__.py b/blessings/__init__.py index 67bbddb..33b5cdc 100644 --- a/blessings/__init__.py +++ b/blessings/__init__.py @@ -10,11 +10,17 @@ except ImportError: pass import os from os import isatty, environ +from platform import python_version_tuple import struct import sys from termios import TIOCGWINSZ +if ('3', '0', '0') <= python_version_tuple() < ('3', '2', '2+'): # Good till 3.2.10 + # Python 3.x < 3.2.3 has a bug in which tparm() erroneously takes a string. + raise ImportError('Blessings needs Python 3.2.3 or greater for Python 3 support due to http://bugs.python.org/issue10570.') + + __all__ = ['Terminal'] |