From 2d883be689cec8aa140dfb3d7693f768c2f4e44d Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 16 Apr 2010 09:04:57 +0200 Subject: [PATCH] safety import fix: 'io' isn't a very unique module name --- Cython/Utils.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Cython/Utils.py b/Cython/Utils.py index 91b8cf49..48877c7b 100644 --- a/Cython/Utils.py +++ b/Cython/Utils.py @@ -130,10 +130,12 @@ class NormalisedNewlineStream(object): data = self._read(0x1000) return u''.join(content).split(u'\n') -try: - import io -except ImportError: - io = None +io = None +if sys.version_info >= (2,6): + try: + import io + except ImportError: + pass def open_source_file(source_filename, mode="r", encoding=None, error_handling=None, -- 2.26.2