mirror of
https://github.com/python/cpython.git
synced 2025-12-05 00:52:25 +00:00
bpo-9850: Deprecate the macpath module (#1540)
Co-Authored-By: Chi Hsuan Yen <yan12125@gmail.com>.
This commit is contained in:
parent
981096f98b
commit
89a1c93f04
4 changed files with 15 additions and 1 deletions
|
|
@ -6,6 +6,8 @@
|
||||||
|
|
||||||
**Source code:** :source:`Lib/macpath.py`
|
**Source code:** :source:`Lib/macpath.py`
|
||||||
|
|
||||||
|
.. deprecated-removed:: 3.7 3.8
|
||||||
|
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
This module is the Mac OS 9 (and earlier) implementation of the :mod:`os.path`
|
This module is the Mac OS 9 (and earlier) implementation of the :mod:`os.path`
|
||||||
|
|
|
||||||
|
|
@ -265,6 +265,8 @@ Deprecated
|
||||||
now deprecated. It never correctly worked. (Contributed by Serhiy Storchaka
|
now deprecated. It never correctly worked. (Contributed by Serhiy Storchaka
|
||||||
in :issue:`28692`.)
|
in :issue:`28692`.)
|
||||||
|
|
||||||
|
- The :mod:`macpath` is now deprecated and will be removed in Python 3.8.
|
||||||
|
|
||||||
|
|
||||||
Changes in the C API
|
Changes in the C API
|
||||||
--------------------
|
--------------------
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,10 @@ import os
|
||||||
from stat import *
|
from stat import *
|
||||||
import genericpath
|
import genericpath
|
||||||
from genericpath import *
|
from genericpath import *
|
||||||
|
import warnings
|
||||||
|
|
||||||
|
warnings.warn('the macpath module is deprecated in 3.7 and will be removed '
|
||||||
|
'in 3.8', DeprecationWarning, stacklevel=2)
|
||||||
|
|
||||||
__all__ = ["normcase","isabs","join","splitdrive","split","splitext",
|
__all__ = ["normcase","isabs","join","splitdrive","split","splitext",
|
||||||
"basename","dirname","commonprefix","getsize","getmtime",
|
"basename","dirname","commonprefix","getsize","getmtime",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,12 @@
|
||||||
import macpath
|
|
||||||
from test import test_genericpath
|
from test import test_genericpath
|
||||||
import unittest
|
import unittest
|
||||||
|
import warnings
|
||||||
|
|
||||||
|
|
||||||
|
with warnings.catch_warnings():
|
||||||
|
warnings.filterwarnings("ignore", "the macpath module is deprecated",
|
||||||
|
DeprecationWarning)
|
||||||
|
import macpath
|
||||||
|
|
||||||
|
|
||||||
class MacPathTestCase(unittest.TestCase):
|
class MacPathTestCase(unittest.TestCase):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue