Add friendly message about Python 3.x being unsupported

A bit better than a traceback.  Also introduce environment variable
DEVELOPING_OFFLINEIMAP_PYTHON3_SUPPORT that will allow developers
to grok the code under Python 3.x.

Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
This commit is contained in:
Eygene Ryabinkin 2014-05-23 21:50:46 +04:00
parent 0005bcb2f0
commit 7770b5ff73
1 changed files with 13 additions and 0 deletions

View File

@ -17,6 +17,19 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import os
import sys
if not 'DEVELOPING_OFFLINEIMAP_PYTHON3_SUPPORT' in os.environ:
if sys.version_info[0] > 2:
sys.stderr.write("""IIMAPS!
Sorry, OfflineIMAP currently doesn't support Python higher than 2.x.
We're doing our best to bring in support for 3.x really soon. You can
also join us at https://github.com/OfflineIMAP/offlineimap/ and help.
""")
sys.exit(1)
from offlineimap import OfflineImap
oi = OfflineImap()