From 6d3941375524f55b7bf7c0bd89c6454b44632e86 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sat, 10 Aug 2013 16:01:36 +0200 Subject: [PATCH] fix for Py<=2.5 --- Cython/Build/Dependencies.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Cython/Build/Dependencies.py b/Cython/Build/Dependencies.py index d718504..eb8ba11 100644 --- a/Cython/Build/Dependencies.py +++ b/Cython/Build/Dependencies.py @@ -768,10 +768,13 @@ def cythonize(module_list, exclude=[], nthreads=0, aliases=None, quiet=False, fo if not os.path.exists(c_file): failed_modules.update(modules) elif os.path.getsize(c_file) < 200: - with io_open(c_file, 'r', encoding='iso8859-1') as f: + f = io_open(c_file, 'r', encoding='iso8859-1') + try: if f.read(len('#error ')) == '#error ': # dead compilation result failed_modules.update(modules) + finally: + f.close() if failed_modules: for module in failed_modules: module_list.remove(module) -- 2.7.4