diff options
author | Brett Cannon <brett@python.org> | 2012-04-16 23:11:28 -0400 |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2012-04-16 23:11:28 -0400 |
commit | 0edf46f42881b0d3d189da6fc176cb6f2938024f (patch) | |
tree | 1ee191d581b0b3407c944174f2b920f6dbc6d812 /Lib/imp.py | |
parent | a045ed1a8ada767dc4cbce8168b5953238da8cbe (diff) | |
download | cpython-0edf46f42881b0d3d189da6fc176cb6f2938024f.tar.gz |
Properly guard against special-casing.
Diffstat (limited to 'Lib/imp.py')
-rw-r--r-- | Lib/imp.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/imp.py b/Lib/imp.py index 0b344d6007..dc685d0e11 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 |