MCPcopy Index your code
hub / github.com/python/cpython / open

Method open

Lib/webbrowser.py:206–219  ·  view source on GitHub ↗
(self, url, new=0, autoraise=True)

Source from the content-addressed store, hash-verified

204 background."""
205
206 def open(self, url, new=0, autoraise=True):
207 cmdline = [self.name] + [arg.replace("%s", url)
208 for arg in self.args]
209 sys.audit("webbrowser.open", url)
210 self._check_url(url)
211 try:
212 if sys.platform[:3] == 'win':
213 p = subprocess.Popen(cmdline)
214 else:
215 p = subprocess.Popen(cmdline, close_fds=True,
216 start_new_session=True)
217 return p.poll() is None
218 except OSError:
219 return False
220
221
222class UnixBrowser(BaseBrowser):

Callers

nothing calls this directly

Calls 3

pollMethod · 0.95
_check_urlMethod · 0.80
replaceMethod · 0.45

Tested by

no test coverage detected