Skip to content

Commit 1155efb

Browse files
Simplify error message for invalid URL- backport
1 parent d498b7e commit 1155efb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/webbrowser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def open_new_tab(self, url):
162162
def _check_url(url):
163163
"""Ensures that the URL is safe to pass to subprocesses as a parameter"""
164164
if url and url.lstrip().startswith("-"):
165-
raise ValueError(f"Invalid URL {url!r}: URLs must not start with '-' after leading whitespace")
165+
raise ValueError(f"Invalid URL: {url}")
166166

167167

168168
class GenericBrowser(BaseBrowser):

0 commit comments

Comments
 (0)