summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/release/upcoming_changes/15255.compatibility.rst12
-rw-r--r--numpy/distutils/compat.py8
-rw-r--r--numpy/tests/test_public_api.py1
3 files changed, 12 insertions, 9 deletions
diff --git a/doc/release/upcoming_changes/15255.compatibility.rst b/doc/release/upcoming_changes/15255.compatibility.rst
new file mode 100644
index 000000000..e360eeeb3
--- /dev/null
+++ b/doc/release/upcoming_changes/15255.compatibility.rst
@@ -0,0 +1,12 @@
+``numpy.distutils.compat`` has been removed
+-------------------------------------------
+This module contained only the function ``get_exception()``, which was used as::
+
+ try:
+ ...
+ except Exception:
+ e = get_exception()
+
+Its purpose was to handle the change in syntax introduced in Python 2.6, from
+``except Exception, e:`` to ``except Exception as e:``, meaning it was only
+necessary for codebases supporting Python 2.5 and older.
diff --git a/numpy/distutils/compat.py b/numpy/distutils/compat.py
deleted file mode 100644
index afe0beedb..000000000
--- a/numpy/distutils/compat.py
+++ /dev/null
@@ -1,8 +0,0 @@
-"""Small modules to cope with python 2 vs 3 incompatibilities inside
-numpy.distutils
-
-"""
-import sys
-
-def get_exception():
- return sys.exc_info()[1]
diff --git a/numpy/tests/test_public_api.py b/numpy/tests/test_public_api.py
index 4ee84034d..48dd42a9f 100644
--- a/numpy/tests/test_public_api.py
+++ b/numpy/tests/test_public_api.py
@@ -225,7 +225,6 @@ PRIVATE_BUT_PRESENT_MODULES = ['numpy.' + s for s in [
"distutils.command.install_data",
"distutils.command.install_headers",
"distutils.command.sdist",
- "distutils.compat",
"distutils.conv_template",
"distutils.core",
"distutils.extension",