From: W. Trevor King Date: Sun, 18 Nov 2012 17:19:15 +0000 (-0500) Subject: rss2email: raise error on import with Python < 3.2. X-Git-Tag: v3.0~48 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ab4dc8af5bb3127695ae442ca3c7232ae9cf01b9;p=rss2email.git rss2email: raise error on import with Python < 3.2. rss2email won't work with older Pythons. Avoid user confusion due to API-breakage error messages [1] by bailing explicitly up front. [1]; http://forums.macrumors.com/showthread.php?t=1216694 --- diff --git a/rss2email/__init__.py b/rss2email/__init__.py index b1eaad3..37dc414 100644 --- a/rss2email/__init__.py +++ b/rss2email/__init__.py @@ -18,6 +18,7 @@ """ import logging as _logging +import sys as _sys __version__ = '2.71' @@ -40,3 +41,9 @@ __contributors__ = [ LOG = _logging.getLogger('rss2email') LOG.addHandler(_logging.StreamHandler()) LOG.setLevel(_logging.ERROR) + + +if _sys.version_info < (3, 2): + raise ImportError( + "rss2email requires Python 3.2, but you're using:\n{}".format( + _sys.version))