Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c229e6e

Browse files
committed
Issue #14040: Remove rarely used file name suffixes for C extensions (under POSIX mainly).
This will improve import performance a bit (especially under importlib).
1 parent ea6b4d5 commit c229e6e

7 files changed

Lines changed: 17 additions & 10 deletions

File tree

Doc/whatsnew/3.3.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,6 +939,20 @@ Porting C code
939939
:c:func:`PyUnicode_FromFormat()`, your code will automatically take
940940
advantage of the new unicode representations.
941941

942+
Building C extensions
943+
---------------------
944+
945+
* The range of possible file names for C extensions has been narrowed.
946+
Very rarely used spellings have been suppressed: under POSIX, files
947+
named ``xxxmodule.so``, ``xxxmodule.abi3.so`` and
948+
``xxxmodule.cpython-*.so`` are no longer recognized as implementing
949+
the ``xxx`` module. If you had been generating such files, you have
950+
to switch to the other spellings (i.e., remove the ``module`` string
951+
from the file names).
952+
953+
(implemented in :issue:`14040`.)
954+
955+
942956
Other issues
943957
------------
944958

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ What's New in Python 3.3 Alpha 1?
1010
Core and Builtins
1111
-----------------
1212

13+
- Issue #14040: Remove rarely used file name suffixes for C extensions
14+
(under POSIX mainly).
15+
1316
- Issue #14051: Allow arbitrary attributes to be set of classmethod and
1417
staticmethod.
1518

Python/dynload_aix.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ typedef struct Module {
2828

2929
const struct filedescr _PyImport_DynLoadFiletab[] = {
3030
{".so", "rb", C_EXTENSION},
31-
{"module.so", "rb", C_EXTENSION},
3231
{0, 0}
3332
};
3433

Python/dynload_dl.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ extern char *Py_GetProgramName(void);
1111

1212
const struct filedescr _PyImport_DynLoadFiletab[] = {
1313
{".o", "rb", C_EXTENSION},
14-
{"module.o", "rb", C_EXTENSION},
1514
{0, 0}
1615
};
1716

Python/dynload_hpux.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
const struct filedescr _PyImport_DynLoadFiletab[] = {
1717
{SHLIB_EXT, "rb", C_EXTENSION},
18-
{"module"SHLIB_EXT, "rb", C_EXTENSION},
1918
{0, 0}
2019
};
2120

Python/dynload_next.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
const struct filedescr _PyImport_DynLoadFiletab[] = {
1212
{".so", "rb", C_EXTENSION},
13-
{"module.so", "rb", C_EXTENSION},
1413
{0, 0}
1514
};
1615

Python/dynload_shlib.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
const struct filedescr _PyImport_DynLoadFiletab[] = {
4040
#ifdef __CYGWIN__
4141
{".dll", "rb", C_EXTENSION},
42-
{"module.dll", "rb", C_EXTENSION},
4342
#else /* !__CYGWIN__ */
4443
#if defined(PYOS_OS2) && defined(PYCC_GCC)
4544
{".pyd", "rb", C_EXTENSION},
@@ -48,15 +47,10 @@ const struct filedescr _PyImport_DynLoadFiletab[] = {
4847
#ifdef __VMS
4948
{".exe", "rb", C_EXTENSION},
5049
{".EXE", "rb", C_EXTENSION},
51-
{"module.exe", "rb", C_EXTENSION},
52-
{"MODULE.EXE", "rb", C_EXTENSION},
5350
#else /* !__VMS */
5451
{"." SOABI ".so", "rb", C_EXTENSION},
55-
{"module." SOABI ".so", "rb", C_EXTENSION},
5652
{".abi" PYTHON_ABI_STRING ".so", "rb", C_EXTENSION},
57-
{"module.abi" PYTHON_ABI_STRING ".so", "rb", C_EXTENSION},
5853
{".so", "rb", C_EXTENSION},
59-
{"module.so", "rb", C_EXTENSION},
6054
#endif /* __VMS */
6155
#endif /* defined(PYOS_OS2) && defined(PYCC_GCC) */
6256
#endif /* __CYGWIN__ */

0 commit comments

Comments
 (0)