From ab4dc8af5bb3127695ae442ca3c7232ae9cf01b9 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 18 Nov 2012 12:19:15 -0500 Subject: [PATCH] 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 --- rss2email/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) 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)) -- 2.26.2