[Python-checkins] cpython: Properly guard against special-casing.

brett.cannon python-checkins at python.org
Tue Apr 17 05:11:34 CEST 2012


http://hg.python.org/cpython/rev/735d3e1e5ca2
changeset: 76372:735d3e1e5ca2
user: Brett Cannon <brett at python.org>
date: Mon Apr 16 23:11:28 2012 -0400
summary:
 Properly guard against special-casing.
files:
 Lib/imp.py | 2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Lib/imp.py b/Lib/imp.py
--- a/Lib/imp.py
+++ b/Lib/imp.py
@@ -36,7 +36,7 @@
 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
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /