From 947ec7ab02e7673956eb7f235c330a49f11e157a Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Fri, 9 Jun 2023 11:52:58 +0300 Subject: gh-105545: Remove deprecated `MacOSXOSAScript._name` (gh-105546) --- Doc/library/webbrowser.rst | 2 +- Doc/whatsnew/3.13.rst | 5 +++++ Lib/webbrowser.py | 14 -------------- .../Library/2023-06-09-08-38-30.gh-issue-105545.2q3ysu.rst | 1 + 4 files changed, 7 insertions(+), 15 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2023-06-09-08-38-30.gh-issue-105545.2q3ysu.rst diff --git a/Doc/library/webbrowser.rst b/Doc/library/webbrowser.rst index 2f0b5fe..b6762f7 100644 --- a/Doc/library/webbrowser.rst +++ b/Doc/library/webbrowser.rst @@ -196,7 +196,7 @@ Browser controllers provide these methods which parallel three of the module-level convenience functions: -.. attribute:: name +.. attribute:: controller.name System-dependent name for the browser. diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index 4849ed7..e3090f1 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -324,6 +324,11 @@ Removed certificates for you. (Contributed by Victor Stinner in :gh:`105382`.) +* Remove deprecated ``webbrowser.MacOSXOSAScript._name`` attribute. + Use :attr:`webbrowser.MacOSXOSAScript.name ` + attribute instead. + (Contributed by Nikita Sobolev in :gh:`105546`.) + Porting to Python 3.13 ====================== diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py index c1bd667..01a82fb 100755 --- a/Lib/webbrowser.py +++ b/Lib/webbrowser.py @@ -578,20 +578,6 @@ if sys.platform == 'darwin': def __init__(self, name='default'): super().__init__(name) - @property - def _name(self): - warnings.warn(f'{self.__class__.__name__}._name is deprecated in 3.11' - f' use {self.__class__.__name__}.name instead.', - DeprecationWarning, stacklevel=2) - return self.name - - @_name.setter - def _name(self, val): - warnings.warn(f'{self.__class__.__name__}._name is deprecated in 3.11' - f' use {self.__class__.__name__}.name instead.', - DeprecationWarning, stacklevel=2) - self.name = val - def open(self, url, new=0, autoraise=True): if self.name == 'default': script = 'open location "%s"' % url.replace('"', '%22') # opens in default browser diff --git a/Misc/NEWS.d/next/Library/2023-06-09-08-38-30.gh-issue-105545.2q3ysu.rst b/Misc/NEWS.d/next/Library/2023-06-09-08-38-30.gh-issue-105545.2q3ysu.rst new file mode 100644 index 0000000..f276921 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2023-06-09-08-38-30.gh-issue-105545.2q3ysu.rst @@ -0,0 +1 @@ +Remove deprecated in 3.11 ``webbrowser.MacOSXOSAScript._name`` attribute. -- cgit v0.12