From 578393b2862173d54baa32684812617b2e995412 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Mon, 16 Apr 2012 23:11:28 -0400 Subject: Properly guard against special-casing. --- Lib/imp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/imp.py b/Lib/imp.py index 0b344d6..dc685d0 100644 --- a/Lib/imp.py +++ b/Lib/imp.py @@ -36,7 +36,7 @@ class _LoadSourceCompatibility(_bootstrap._SourceFileLoader): def get_data(self, path): """Gross hack to contort SourceFileLoader to deal w/ load_source()'s bad API.""" - if path == self._path: + if self.file and path == self._path: with self.file: # Technically should be returning bytes, but # SourceLoader.get_code() just passed what is returned to -- cgit v0.12