From 0984ba08891e0420d2e099578bcd73addb13ef01 Mon Sep 17 00:00:00 2001 From: Roumen Petrov Date: Sat, 15 Sep 2012 01:35:46 +0300 Subject: [PATCH 16/17] CROSS-reload may fail with operation on closed file on readonly filesystem if byte code does not exist --- Lib/imp.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Lib/imp.py b/Lib/imp.py index da9c84e..a5ad8af 100644 --- a/Lib/imp.py +++ b/Lib/imp.py @@ -84,7 +84,7 @@ class _HackedGetData: def get_data(self, path): """Gross hack to contort loader to deal w/ load_*()'s bad API.""" - if self.file and path == self.path: + if self.file and path == self.path and not self.file.closed: with self.file: # Technically should be returning bytes, but # SourceLoader.get_code() just passed what is returned to -- 1.7.4.4