Skip to content

Commit

Permalink
Add friendly message about Python 3.x being unsupported
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
konvpalto committed May 23, 2014
1 parent 0005bcb commit 7770b5f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions offlineimap.py
Expand Up @@ -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()
Expand Down

0 comments on commit 7770b5f

Please sign in to comment.