From: Stefan Behnel Date: Fri, 16 Apr 2010 07:04:57 +0000 (+0200) Subject: safety import fix: 'io' isn't a very unique module name X-Git-Tag: 0.13.beta0~191 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2d883be689cec8aa140dfb3d7693f768c2f4e44d;p=cython.git safety import fix: 'io' isn't a very unique module name --- 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,