8000 bpo-43424: Deprecate `webbrowser.MacOSXOSAScript._name` attribute by sobolevn · Pull Request #30241 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-43424: Deprecate webbrowser.MacOSXOSAScript._name attribute #30241

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 4 commits into from
Dec 30, 2021
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Also include setter
  • Loading branch information
sobolevn committed Dec 23, 2021
commit 17687be7a682b1a79f8cfe38bf10e27005bd6557
7 changes: 7 additions & 0 deletions Lib/webbrowser.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,13 @@ def _name(self):
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
0