A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2009-January/084682.html below:

[Python-Dev] patch suggestion for webbrowser

[Python-Dev] patch suggestion for webbrowser [Python-Dev] patch suggestion for webbrowserYinon Ehrlich yinon.me at gmail.com
Thu Jan 1 13:24:02 CET 2009
Hi,

enclosed a patch for webbrowser which will find applications/batch files 
ending with .com or .cmd too.
Yinon

Index: Lib/webbrowser.py
===================================================================
--- Lib/webbrowser.py    (revision 68118)
+++ Lib/webbrowser.py    (working copy)
@@ -103,10 +103,11 @@
 
 if sys.platform[:3] == "win":
     def _isexecutable(cmd):
+        win_exts = (".exe", ".com", ".bat", ".cmd")
         cmd = cmd.lower()
-        if os.path.isfile(cmd) and cmd.endswith((".exe", ".bat")):
+        if os.path.isfile(cmd) and cmd.endswith(win_exts):
             return True
-        for ext in ".exe", ".bat":
+        for ext in win_exts:
             if os.path.isfile(cmd + ext):
                 return True
         return False

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4