Skip to content

Commit bc1c49f

Browse files
corona10ambv
andauthored
bpo-42255: Deprecate webbrowser.MacOSX from Python 3.11 (GH-27837)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
1 parent 85ea2d6 commit bc1c49f

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

Doc/library/webbrowser.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ for the controller classes, all defined in this module.
143143
+------------------------+-----------------------------------------+-------+
144144
| ``'windows-default'`` | :class:`WindowsDefault` | \(2) |
145145
+------------------------+-----------------------------------------+-------+
146-
| ``'macosx'`` | :class:`MacOSX('default')` | \(3) |
146+
| ``'macosx'`` | :class:`MacOSXOSAScript('default')` | \(3) |
147147
+------------------------+-----------------------------------------+-------+
148-
| ``'safari'`` | :class:`MacOSX('safari')` | \(3) |
148+
| ``'safari'`` | :class:`MacOSXOSAScript('safari')` | \(3) |
149149
+------------------------+-----------------------------------------+-------+
150150
| ``'google-chrome'`` | :class:`Chrome('google-chrome')` | |
151151
+------------------------+-----------------------------------------+-------+
@@ -174,6 +174,9 @@ Notes:
174174
.. versionadded:: 3.3
175175
Support for Chrome/Chromium has been added.
176176

177+
.. deprecated-removed:: 3.11 3.13
178+
:class:`MacOSX` is deprecated, use :class:`MacOSXOSAScript` instead.
179+
177180
Here are some simple examples::
178181

179182
url = 'https://docs.python.org/'

Doc/whatsnew/3.11.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,10 @@ Deprecated
292292
Python 3.10 or newer. See the :pep:`617` (New PEG parser for CPython).
293293
(Contributed by Victor Stinner in :issue:`40360`.)
294294

295+
* :class:`webbrowser.MacOSX` is deprecated and will be removed in Python 3.13.
296+
It is untested and undocumented and also not used by webbrowser itself.
297+
(Contributed by Dong-hee Na in :issue:`42255`.)
298+
295299

296300
Removed
297301
=======

Lib/webbrowser.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import sys
99
import subprocess
1010
import threading
11+
import warnings
1112

1213
__all__ = ["Error", "open", "open_new", "open_new_tab", "get", "register"]
1314

@@ -629,6 +630,8 @@ class MacOSX(BaseBrowser):
629630
Internet System Preferences panel, will be used.
630631
"""
631632
def __init__(self, name):
633+
warnings.warn(f'{self.__class__.__name__} is deprecated in 3.11'
634+
' use MacOSXOSAScript instead.', DeprecationWarning, stacklevel=2)
632635
self.name = name
633636

634637
def open(self, url, new=0, autoraise=True):
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
:class:`webbrowser.MacOSX` is deprecated and will be removed in Python 3.13.
2+
It is untested and undocumented and also not used by webbrowser itself.
3+
Patch by Dong-hee Na.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy