diff options
author | Collin Winter <collinw@gmail.com> | 2007-08-30 01:19:48 +0000 |
---|---|---|
committer | Collin Winter <collinw@gmail.com> | 2007-08-30 01:19:48 +0000 |
commit | ce36ad8a467d914eb5c91f33835b9eaea18ee93b (patch) | |
tree | 05bf654f3359e20b455dc300bd860bba5d291c8d /Lib/modulefinder.py | |
parent | Copying the email package back, despite its failings. (diff) | |
download | cpython-ce36ad8a467d914eb5c91f33835b9eaea18ee93b.tar.gz cpython-ce36ad8a467d914eb5c91f33835b9eaea18ee93b.tar.bz2 cpython-ce36ad8a467d914eb5c91f33835b9eaea18ee93b.zip |
Raise statement normalization in Lib/.
Diffstat (limited to 'Lib/modulefinder.py')
-rw-r--r-- | Lib/modulefinder.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/modulefinder.py b/Lib/modulefinder.py index d5328bccd54..a57911c1b2d 100644 --- a/Lib/modulefinder.py +++ b/Lib/modulefinder.py @@ -146,7 +146,7 @@ class ModuleFinder: self.msgout(4, "determine_parent ->", parent) return parent if pname.count(".") < level: - raise ImportError, "relative importpath too deep" + raise ImportError("relative importpath too deep") pname = ".".join(pname.split(".")[:-level]) parent = self.modules[pname] self.msgout(4, "determine_parent ->", parent) @@ -191,7 +191,7 @@ class ModuleFinder: self.msgout(4, "find_head_package ->", (q, tail)) return q, tail self.msgout(4, "raise ImportError: No module named", qname) - raise ImportError, "No module named " + qname + raise ImportError("No module named " + qname) def load_tail(self, q, tail): self.msgin(4, "load_tail", q, tail) @@ -204,7 +204,7 @@ class ModuleFinder: m = self.import_module(head, mname, m) if not m: self.msgout(4, "raise ImportError: No module named", mname) - raise ImportError, "No module named " + mname + raise ImportError("No module named " + mname) self.msgout(4, "load_tail ->", m) return m @@ -220,7 +220,7 @@ class ModuleFinder: subname = "%s.%s" % (m.__name__, sub) submod = self.import_module(sub, subname, m) if not submod: - raise ImportError, "No module named " + subname + raise ImportError("No module named " + subname) def find_all_submodules(self, m): if not m.__path__: @@ -291,7 +291,7 @@ class ModuleFinder: elif type == imp.PY_COMPILED: if fp.read(4) != imp.get_magic(): self.msgout(2, "raise ImportError: Bad magic number", pathname) - raise ImportError, "Bad magic number in %s" % pathname + raise ImportError("Bad magic number in %s" % pathname) fp.read(4) co = marshal.load(fp) else: @@ -470,7 +470,7 @@ class ModuleFinder: fullname = name if fullname in self.excludes: self.msgout(3, "find_module -> Excluded", fullname) - raise ImportError, name + raise ImportError(name) if path is None: if name in sys.builtin_module_names: |