From 5ba1a012164a56a275fad6426816df7e7b4b4358 Mon Sep 17 00:00:00 2001 From: David Euresti Date: Thu, 13 Apr 2017 20:15:37 -0700 Subject: [PATCH] Make webbrowser module unicode friendly in Python 2 (#1159) * Make webbrowser module unicode friendly in Python 2 * CR changes --- stdlib/2and3/webbrowser.pyi | 42 ++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/stdlib/2and3/webbrowser.pyi b/stdlib/2and3/webbrowser.pyi index a478edfd0..f4ddb1550 100644 --- a/stdlib/2and3/webbrowser.pyi +++ b/stdlib/2and3/webbrowser.pyi @@ -3,34 +3,34 @@ # NOTE: This dynamically typed stub was automatically generated by stubgen. import sys -from typing import Any, Optional, Callable, List +from typing import Any, Optional, Callable, List, Text, Union, Sequence class Error(Exception): ... -def register(name: str, klass: Optional[Callable[[], BaseBrowser]], instance: BaseBrowser=..., update_tryorder: int=...) -> None: ... -def get(using: str=...) -> BaseBrowser: ... -def open(url: str, new: int=..., autoraise: bool=...) -> bool: ... -def open_new(url: str) -> bool: ... -def open_new_tab(url: str) -> bool: ... +def register(name: Text, klass: Optional[Callable[[], BaseBrowser]], instance: BaseBrowser = ..., update_tryorder: int = ...) -> None: ... +def get(using: Optional[Text] = ...) -> BaseBrowser: ... +def open(url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... +def open_new(url: Text) -> bool: ... +def open_new_tab(url: Text) -> bool: ... class BaseBrowser: args = ... # type: List[str] name = ... # type: str basename = ... # type: str - def __init__(self, name: str=...) -> None: ... - def open(self, url: str, new: int=..., autoraise: bool=...) -> bool: ... - def open_new(self, url: str) -> bool: ... - def open_new_tab(self, url: str) -> bool: ... + def __init__(self, name: Text = ...) -> None: ... + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... + def open_new(self, url: Text) -> bool: ... + def open_new_tab(self, url: Text) -> bool: ... class GenericBrowser(BaseBrowser): args = ... # type: List[str] name = ... # type: str basename = ... # type: str - def __init__(self, name: str) -> None: ... - def open(self, url: str, new: int=..., autoraise: bool=...) -> bool: ... + def __init__(self, name: Union[Text, Sequence[Text]]) -> None: ... + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... class BackgroundBrowser(GenericBrowser): - def open(self, url: str, new: int=..., autoraise: bool=...) -> bool: ... + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... class UnixBrowser(BaseBrowser): raise_opts = ... # type: List[str] @@ -40,7 +40,7 @@ class UnixBrowser(BaseBrowser): remote_action = ... # type: str remote_action_newwin = ... # type: str remote_action_newtab = ... # type: str - def open(self, url: str, new: int=..., autoraise: bool=...) -> bool: ... + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... class Mozilla(UnixBrowser): raise_opts = ... # type: List[str] @@ -82,19 +82,19 @@ class Elinks(UnixBrowser): redirect_stdout = ... # type: bool class Konqueror(BaseBrowser): - def open(self, url: str, new: int=..., autoraise: bool=...) -> bool: ... + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... class Grail(BaseBrowser): - def open(self, url: str, new: int=..., autoraise: bool=...) -> bool: ... + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... class WindowsDefault(BaseBrowser): - def open(self, url: str, new: int=..., autoraise: bool=...) -> bool: ... + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... class MacOSX(BaseBrowser): name = ... # type: str - def __init__(self, name: str) -> None: ... - def open(self, url: str, new: int=..., autoraise: bool=...) -> bool: ... + def __init__(self, name: Text) -> None: ... + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... class MacOSXOSAScript(BaseBrowser): - def __init__(self, name: str) -> None: ... - def open(self, url: str, new: int=..., autoraise: bool=...) -> bool: ... + def __init__(self, name: Text) -> None: ... + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ...