]> granicus.if.org Git - python/commitdiff
Remove PEP 291 compatibility requirements for ctypes and modulefinder
authorMartin Panter <vadmium+py@gmail.com>
Sat, 14 May 2016 07:25:37 +0000 (07:25 +0000)
committerMartin Panter <vadmium+py@gmail.com>
Sat, 14 May 2016 07:25:37 +0000 (07:25 +0000)
https://mail.python.org/pipermail/python-dev/2016-May/144502.html

20 files changed:
Lib/ctypes/__init__.py
Lib/ctypes/_endian.py
Lib/ctypes/macholib/__init__.py
Lib/ctypes/macholib/dyld.py
Lib/ctypes/macholib/dylib.py
Lib/ctypes/macholib/framework.py
Lib/ctypes/test/test_structures.py
Lib/ctypes/util.py
Lib/ctypes/wintypes.py
Lib/modulefinder.py
Misc/NEWS
Modules/_ctypes/_ctypes.c
Modules/_ctypes/_ctypes_test.c
Modules/_ctypes/callbacks.c
Modules/_ctypes/callproc.c
Modules/_ctypes/cfield.c
Modules/_ctypes/ctypes.h
Modules/_ctypes/ctypes_dlfcn.h
Modules/_ctypes/malloc_closure.c
Modules/_ctypes/stgdict.c

index 77b020a967c30fb6b48364feea473a5d7becaa36..e24cfd2bede233ba814faaba221c738537fe63aa 100644 (file)
@@ -1,6 +1,3 @@
-######################################################################
-#  This file should be kept compatible with Python 2.3, see PEP 291. #
-######################################################################
 """create and manipulate C data types in Python"""
 
 import os as _os, sys as _sys
index f80e675aaf273184d91f532f1bb9fe8cdd074443..c0ba646ffc9001603d8a0215f0234e2c42d79d5b 100644 (file)
@@ -1,6 +1,3 @@
-######################################################################
-#  This file should be kept compatible with Python 2.3, see PEP 291. #
-######################################################################
 import sys
 from ctypes import *
 
index 36149d28a1506c56346c127b277702f1e8123fb2..5621defccd61d1c4b0c64b8e136ef4357052dcb3 100644 (file)
@@ -1,6 +1,3 @@
-######################################################################
-#  This file should be kept compatible with Python 2.3, see PEP 291. #
-######################################################################
 """
 Enough Mach-O to make your head spin.
 
index 9714ec655f03d700afefc89a5a24a1baedb0e798..1fdf8d648f704e8eab0fb47733d3a0d62d051b4d 100644 (file)
@@ -1,6 +1,3 @@
-######################################################################
-#  This file should be kept compatible with Python 2.3, see PEP 291. #
-######################################################################
 """
 dyld emulation
 """
index ea3dd38bdfb864fff8fe84687cf5572c49be742a..aa107507bd4a9a8bd61cdfdc008855ccc09d6c10 100644 (file)
@@ -1,6 +1,3 @@
-######################################################################
-#  This file should be kept compatible with Python 2.3, see PEP 291. #
-######################################################################
 """
 Generic dylib path manipulation
 """
index dd7fb2f296a895ab628686c36c3f2c15f0fc198d..ad6ed554ba0c221a0673e077f451fc7fbac25f24 100644 (file)
@@ -1,6 +1,3 @@
-######################################################################
-#  This file should be kept compatible with Python 2.3, see PEP 291. #
-######################################################################
 """
 Generic framework path manipulation
 """
index 2fa42bd62f7b5f9b63bc422e105781092bf59f81..f983a6b54a8c5c10c5a7a07c33e37ab596aac859 100644 (file)
@@ -326,6 +326,7 @@ class StructureTestCase(unittest.TestCase):
                                  "(Phone) <type 'exceptions.TypeError'>: "
                                  "expected string or Unicode object, int found")
         else:
+            # Compatibility no longer strictly required
             self.assertEqual(msg,
                                  "(Phone) exceptions.TypeError: "
                                  "expected string or Unicode object, int found")
index 929a29c46091fe71f67c05d72cf16944c3e28c80..bf1b6a012ae3de27f728e3638cd2949b07cddfc1 100644 (file)
@@ -1,6 +1,3 @@
-######################################################################
-#  This file should be kept compatible with Python 2.3, see PEP 291. #
-######################################################################
 import sys, os
 
 # find_library(name) returns the pathname of a library, or None.
index dafbb78b7816409c122c618067577e59e4cc92c0..e7f569c9b6514eac004e192e745569801b5f707d 100644 (file)
@@ -1,7 +1,3 @@
-######################################################################
-#  This file should be kept compatible with Python 2.3, see PEP 291. #
-######################################################################
-
 # The most useful windows datatypes
 from ctypes import *
 
index 2ffd44854b4c4ca2cd4cadf197dc4370051e5950..e2fee4189e4a59c82165612a6a5764fb990a328f 100644 (file)
@@ -1,5 +1,4 @@
 """Find modules used by a script, using introspection."""
-# This module should be kept compatible with Python 2.2, see PEP 291.
 
 from __future__ import generators
 import dis
@@ -13,7 +12,7 @@ import struct
 if hasattr(sys.__stdout__, "newlines"):
     READ_MODE = "U"  # universal line endings
 else:
-    # remain compatible with Python  < 2.3
+    # Python < 2.3 compatibility, no longer strictly required
     READ_MODE = "r"
 
 LOAD_CONST = dis.opmap['LOAD_CONST']
index 025fa3e9477038a18c25a98c30323f7774c33684..b1a1d28ce539a6e65b64d388eaed94828d7dc383 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -77,6 +77,9 @@ Core and Builtins
 Library
 -------
 
+- Removed the requirements for the ctypes and modulefinder modules to be
+  compatible with earlier Python versions.
+
 - Issue #22274: In the subprocess module, allow stderr to be redirected to
   stdout even when stdout is not redirected.  Patch by Akira Li.
 
index fe79b08c0046a3c8ff0a432642fce6288b81f78b..9baf4b36ff7662352cc9eb2637a0f488076bb7db 100644 (file)
@@ -1,5 +1,6 @@
 /*****************************************************************
-  This file should be kept compatible with Python 2.3, see PEP 291.
+  This file contains remnant Python 2.3 compatibility code that is no longer
+  strictly required.
  *****************************************************************/
 
 
index a52f650a2b52dec0e1b44092b9c2d26222767d2d..57628b899394be1e257d736ea7d250aae1c318c1 100644 (file)
@@ -1,12 +1,7 @@
-/*****************************************************************
-  This file should be kept compatible with Python 2.3, see PEP 291.
- *****************************************************************/
-
-
 #include <Python.h>
 
 /*
-  Backwards compatibility:
+  Backwards compatibility, no longer strictly required:
   Python2.2 used LONG_LONG instead of PY_LONG_LONG
 */
 #if defined(HAVE_LONG_LONG) && !defined(PY_LONG_LONG)
index 47dbe05a5159e0c8614f4dfdff092e92f8f5b00a..b1e85ced8eaf2f272056e0dca6dbcf0c9511e695 100644 (file)
@@ -1,5 +1,6 @@
 /*****************************************************************
-  This file should be kept compatible with Python 2.3, see PEP 291.
+  This file contains remnant Python 2.3 compatibility code that is no longer
+  strictly required.
  *****************************************************************/
 
 #include "Python.h"
index 7007b7cebd456993704827e50995e3412b1e6166..280a31582812002813293c18bd7f0b9e55362cec 100644 (file)
@@ -1,5 +1,6 @@
 /*****************************************************************
-  This file should be kept compatible with Python 2.3, see PEP 291.
+  This file contains remnant Python 2.3 compatibility code that is no longer
+  strictly required.
  *****************************************************************/
 
 
index 85b5ad28903fb10f8e4e668c26a16d0168c3a5db..0585ed28dd9ba53ce783718edcff783036a3a01f 100644 (file)
@@ -1,5 +1,6 @@
 /*****************************************************************
-  This file should be kept compatible with Python 2.3, see PEP 291.
+  This file contains remnant Python 2.3 compatibility code that is no longer
+  strictly required.
  *****************************************************************/
 
 #include "Python.h"
index b88cf4f4695915051eb541c550c52d3776105e93..a61ce5f3264559fb85cc95ac2a57615925746451 100644 (file)
@@ -1,5 +1,6 @@
 /*****************************************************************
-  This file should be kept compatible with Python 2.3, see PEP 291.
+  This file contains remnant Python 2.3 compatibility code that is no longer
+  strictly required.
  *****************************************************************/
 
 #if defined (__SVR4) && defined (__sun)
index d8bf904be20419f1d20def6986f82ce555276855..54cdde9a4fdb02450bbc4d7b81b2dfcf778772c9 100644 (file)
@@ -1,7 +1,3 @@
-/*****************************************************************
-  This file should be kept compatible with Python 2.3, see PEP 291.
- *****************************************************************/
-
 #ifndef _CTYPES_DLFCN_H_
 #define _CTYPES_DLFCN_H_
 
index b98d43b6d050da35d142ac07cb029a2b34f3472b..248c6a67022bae0cabef82e619c767ba5850a383 100644 (file)
@@ -1,7 +1,3 @@
-/*****************************************************************
-  This file should be kept compatible with Python 2.3, see PEP 291.
- *****************************************************************/
-
 #include <Python.h>
 #include <ffi.h>
 #ifdef MS_WIN32
index 17b97601436cfca9ac45d4a4e6d452d8893171f6..31528af0f7c4c2f11256696d4e76c63e427f88a5 100644 (file)
@@ -1,7 +1,3 @@
-/*****************************************************************
-  This file should be kept compatible with Python 2.3, see PEP 291.
- *****************************************************************/
-
 #include "Python.h"
 #include <ffi.h>
 #ifdef MS_WIN32
@@ -449,6 +445,7 @@ PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct
             Py_DECREF(pair);
             PyErr_Format(PyExc_TypeError,
 #if (PY_VERSION_HEX < 0x02050000)
+                         /* Compatibility no longer strictly required */
                          "second item in _fields_ tuple (index %d) must be a C type",
 #else
                          "second item in _fields_ tuple (index %zd) must be a C type",