Skip to content

Commit

Permalink
pythongh-105545: Remove deprecated MacOSXOSAScript._name (pythongh-…
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn authored Jun 9, 2023
1 parent 3e525d2 commit 947ec7a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
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.

0 comments on commit 947ec7a

Please sign in to comment.