From: Skip Montanaro Date: Wed, 18 Jul 2001 23:14:25 +0000 (+0000) Subject: this closes patches item 429136 and brings the release21-maint version into X-Git-Tag: v2.1.1~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d92dc79c3b3bafce3cf04563c73410fca08ed89e;p=thirdparty%2FPython%2Fcpython.git this closes patches item 429136 and brings the release21-maint version into sync with the head branch. --- diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py index ad195e0a3d09..055705de90b4 100644 --- a/Lib/webbrowser.py +++ b/Lib/webbrowser.py @@ -306,11 +306,14 @@ if os.environ.has_key("BROWSER"): # It's the user's responsibility to register handlers for any unknown # browser referenced by this value, before calling open(). _tryorder = os.environ["BROWSER"].split(":") -else: - # Optimization: filter out alternatives that aren't available, so we can - # avoid has_key() tests at runtime. (This may also allow some unused - # classes and class-instance storage to be garbage-collected.) - _tryorder = filter(lambda x: _browsers.has_key(x.lower()) - or x.find("%s") > -1, _tryorder) + +for cmd in _tryorder: + if not _browsers.has_key(cmd.lower()): + if _iscommand(cmd.lower()): + register(cmd.lower(), None, GenericBrowser("%s %%s" % cmd.lower())) + +_tryorder = filter(lambda x: _browsers.has_key(x.lower()) + or x.find("%s") > -1, _tryorder) +# what to do if _tryorder is now empty? # end