Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions Doc/library/macpath.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

**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`
Expand Down
2 changes: 2 additions & 0 deletions Doc/whatsnew/3.7.rst
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,8 @@ Deprecated
now deprecated. It never correctly worked. (Contributed by Serhiy Storchaka
in :issue:`28692`.)

- The :mod:`macpath` is now deprecated and will be removed in Python 3.8.


Changes in the C API
--------------------
Expand Down
4 changes: 4 additions & 0 deletions Lib/macpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
from stat import *
import genericpath
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",
"basename","dirname","commonprefix","getsize","getmtime",
Expand Down
8 changes: 7 additions & 1 deletion Lib/test/test_macpath.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import macpath
from test import test_genericpath
import unittest
import warnings


with warnings.catch_warnings():
warnings.filterwarnings("ignore", "the macpath module is deprecated",
DeprecationWarning)
import macpath


class MacPathTestCase(unittest.TestCase):
Expand Down