diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2003-01-02 21:33:15 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2003-01-02 21:33:15 (GMT) |
commit | d5ac8d0b3990853d3dfaa6f7029c71dadeee10b1 (patch) | |
tree | 923e0db54f60e85ffdc9e765f8d145afa16e6e1f | |
parent | 397301eccb945ea98d03d3022882900a9fd2046f (diff) | |
download | cpython-d5ac8d0b3990853d3dfaa6f7029c71dadeee10b1.zip cpython-d5ac8d0b3990853d3dfaa6f7029c71dadeee10b1.tar.gz cpython-d5ac8d0b3990853d3dfaa6f7029c71dadeee10b1.tar.bz2 |
Fix PEP 302 description; bump version number
-rw-r--r-- | Doc/whatsnew/whatsnew23.tex | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/Doc/whatsnew/whatsnew23.tex b/Doc/whatsnew/whatsnew23.tex index 2133060..1d2dc3e 100644 --- a/Doc/whatsnew/whatsnew23.tex +++ b/Doc/whatsnew/whatsnew23.tex @@ -2,7 +2,7 @@ % $Id$ \title{What's New in Python 2.3} -\release{0.06} +\release{0.07} \author{A.M. Kuchling} \authoraddress{\email{amk@amk.ca}} @@ -717,9 +717,11 @@ Gordon McMillan's \module{iu} module. Three new items are added to the \module{sys} module: \begin{itemize} - \item \code{sys.path_hooks} is a list of functions. Each function -takes a string containing a path and returns either \code{None} or an -importer object that will handle imports from this path. + \item \code{sys.path_hooks} is a list of callable objects; most +often they'll be classes. Each callable takes a string containing +a path and either returns an importer object that will handle imports +from this path or raises an \exception{ImportError} exception if it +can't handle this path. \item \code{sys.path_importer_cache} caches importer objects for each path, so \code{sys.path_hooks} will only need to be traversed @@ -747,11 +749,16 @@ like this (simplified a bit; see \pep{302} for the full details): for mp in sys.meta_path: loader = mp(fullname) if loader is not None: - <module> = loader(fullname) + <module> = loader.load_module(fullname) for path in sys.path: for hook in sys.path_hooks: - importer = hook(path) + try: + importer = hook(path) + except ImportError: + # ImportError, so try the other path hooks + pass + else: if importer is not None: loader = importer.find_module(fullname) <module> = loader.load_module(fullname) @@ -2014,9 +2021,9 @@ name. The author would like to thank the following people for offering suggestions, corrections and assistance with various drafts of this article: Simon Brunning, Michael Chermside, Scott David Daniels, -Fred~L. Drake, Jr., Kelly Gerber, Raymond Hettinger, Michael Hudson, Detlef Lannert, -Martin von L\"owis, Andrew MacIntyre, Lalo Martins, Gustavo Niemeyer, -Neal Norwitz, Chris Reedy, Vinay Sajip, Neil Schemenauer, Jason -Tishler. +Fred~L. Drake, Jr., Kelly Gerber, Raymond Hettinger, Michael Hudson, +Detlef Lannert, Martin von L\"owis, Andrew MacIntyre, Lalo Martins, +Gustavo Niemeyer, Neal Norwitz, Hans Nowak, Chris Reedy, Vinay Sajip, +Neil Schemenauer, Jason Tishler, Just van~Rossum. \end{document} |