Skip to content
Open
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
8 changes: 8 additions & 0 deletions Doc/whatsnew/3.16.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,20 @@ functools
* Calling the Python implementation of :func:`functools.reduce` with *function*
or *sequence* as keyword arguments has been deprecated since Python 3.14.

shutil
------

* The :exc:`!ExecError` exception which has been deprecated since Python 3.14.
It has not been used by any function in :mod:`!shutil` since Python 3.4.
(Contributed by Stan Ulbrych in :gh:`149567`.)

sysconfig
---------

* The :func:`!sysconfig.expand_makefile_vars` function
which has been deprecated since Python 3.14.
Use the ``vars`` argument of :func:`sysconfig.get_paths` instead.
(Contributed by Stan Ulbrych in :gh:`149499`.)

.. Add removals above alphabetically, not here at the end.

Expand Down
12 changes: 0 additions & 12 deletions Lib/shutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -1638,15 +1638,3 @@ def which(cmd, mode=os.F_OK | os.X_OK, path=None):
if _access_check(name, mode):
return name
return None

def __getattr__(name):
if name == "ExecError":
import warnings
warnings._deprecated(
"shutil.ExecError",
f"{warnings._DEPRECATED_MSG}; it "
"isn't raised by any shutil function.",
remove=(3, 16)
)
return RuntimeError
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
4 changes: 2 additions & 2 deletions Lib/test/test_peepholer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1127,8 +1127,8 @@ def test_import_from_doesnt_clobber_load_fast_borrow(self):
def f(self):
if x: pass
self.x
from shutil import ExecError
print(ExecError)
from heapq import heapify_max
Copy link
Copy Markdown
Member Author

@StanFromIreland StanFromIreland May 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out it was used somewhere after all! Technically this doesn't matter, but to avoid any potential confusion I changed it to something else.

I confirmed it still fails when 1561385 is reverted.

print(heapify_max)
self.assertInBytecode(f, "LOAD_FAST_BORROW", "self")

class DirectCfgOptimizerTests(CfgOptimizationTestCase):
Expand Down
2 changes: 0 additions & 2 deletions Lib/test/test_shutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -3580,8 +3580,6 @@ def test_module_all_attribute(self):
if hasattr(os, 'statvfs') or os.name == 'nt':
target_api.append('disk_usage')
self.assertEqual(set(shutil.__all__), set(target_api))
with self.assertWarns(DeprecationWarning):
from shutil import ExecError # noqa: F401


if __name__ == '__main__':
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Remove the :exc:`!shutil.ExecError` exception which has been deprecated
since Python 3.14.
Loading