gh-105545: Remove deprecated MacOSXOSAScript._name (gh-105546)

This commit is contained in:
Nikita Sobolev 2023-06-09 11:52:58 +03:00 committed by GitHub
parent 3e525d2212
commit 947ec7ab02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 15 deletions

View file

@ -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.

View file

@ -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
======================

View file

@ -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

View file

@ -0,0 +1 @@
Remove deprecated in 3.11 ``webbrowser.MacOSXOSAScript._name`` attribute.