Skip to content

gh-105545: Remove deprecated MacOSXOSAScript._name #105546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/library/webbrowser.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
5 changes: 5 additions & 0 deletions Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <webbrowser.controller.name>`
attribute instead.
(Contributed by Nikita Sobolev in :gh:`105546`.)


Porting to Python 3.13
======================
Expand Down
14 changes: 0 additions & 14 deletions Lib/webbrowser.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,20 +578,6 @@ class MacOSXOSAScript(BaseBrowser):
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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove deprecated in 3.11 ``webbrowser.MacOSXOSAScript._name`` attribute.