Kaydet (Commit) 9bd059ff authored tarafından Brett Cannon's avatar Brett Cannon

Silence warnings under -3 about using dict.has_key() for modulefinder.

üst 5dd504df
...@@ -258,7 +258,7 @@ class ModuleFinder: ...@@ -258,7 +258,7 @@ class ModuleFinder:
else: else:
self.msgout(3, "import_module ->", m) self.msgout(3, "import_module ->", m)
return m return m
if self.badmodules.has_key(fqname): if fqname in self.badmodules:
self.msgout(3, "import_module -> None") self.msgout(3, "import_module -> None")
return None return None
if parent and parent.__path__ is None: if parent and parent.__path__ is None:
...@@ -279,7 +279,8 @@ class ModuleFinder: ...@@ -279,7 +279,8 @@ class ModuleFinder:
self.msgout(3, "import_module ->", m) self.msgout(3, "import_module ->", m)
return m return m
def load_module(self, fqname, fp, pathname, (suffix, mode, type)): def load_module(self, fqname, fp, pathname, file_info):
suffix, mode, type = file_info
self.msgin(2, "load_module", fqname, fp and "fp", pathname) self.msgin(2, "load_module", fqname, fp and "fp", pathname)
if type == imp.PKG_DIRECTORY: if type == imp.PKG_DIRECTORY:
m = self.load_package(fqname, pathname) m = self.load_package(fqname, pathname)
...@@ -460,7 +461,7 @@ class ModuleFinder: ...@@ -460,7 +461,7 @@ class ModuleFinder:
return m return m
def add_module(self, fqname): def add_module(self, fqname):
if self.modules.has_key(fqname): if fqname in self.modules:
return self.modules[fqname] return self.modules[fqname]
self.modules[fqname] = m = Module(fqname) self.modules[fqname] = m = Module(fqname)
return m return m
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment